Hey. Basically I am totally stuck whit this problem, and I am trying to find an answer for several months. I am trying to create a fly controller for mesh object. The idea is to simulate a first person 360*360*360 controller, similar whit regular first person controller but with additional dimension. If user looks up, the plane should go up and if user looks down the plane will go down.
So far I have came up whit this.
camera.y += Math.sin(camera.rotationX * Math.PI / 180)*(Math.sin(camera.rotationY * Math.PI /180)-Math.cos(camera.rotationZ * Math.PI / 180));
camera.z -= Math.cos(camera.rotationY * Math.PI / 180)*(Math.sin(camera.rotationZ * Math.PI / 180)-Math.cos(camera.rotationX * Math.PI / 180));
camera.x += Math.sin(camera.rotationY* Math.PI/180);
how ever there is a problem. This formula works OK until I one point and than just goes bananas. When I perform a couple of loops, the fly gets uncontrollable and the camera goes backward, or side by… Any ideas? I am going crazy whit this one…