A newbie to the stackoverflow member, a newbie to a 3D programmer and far from mathematical math wiz ... so I will try to formulate this question as clearly as I can, hoping it makes sense, and hoping for an answer that my mind will not take.
I wrote a very cool application using three.js that allows the user to fly through 3D space and explore the solar system. The flight model is freely based on the Fly.Controller example / extension in the three.js package, which taught me how to use quaternions to support all axis rotations relative to each other. The flying part works great.
Here's my dilemma: when using quaternions, how can I determine the "normal" (I don’t know what else to call) rotation values to determine which direction I am facing? When using quaternions, the “rotation” structure inside the camera object remains equal to 0.0.0. Therefore, although I can fly freely in space from any angle, I cannot figure out how to determine in which direction I have encountered. Is there a built-in function three.js or another simple way to convert it?
I found several similar, confusing pointers on the Internet, but I can not decrypt and use anything for use in three.js. Thanks.
J sprague
source share