Maxxra
05-04-2012 16:57:26
I'm trying to do something relatively simple: figure out the orientation of a mesh as a vector, normalize the direction vector, add it to the current position of the mesh.
In other words, I want this mesh to "go forward".
I'm running into some problems - not the least of which is the realization that I need to read up on quaternions.
Is there an optimized way to convert q into a vector 3? Also, from my understanding Quaternions are defined as an axis and a rotation (w,x,y,z) - why would the orientation return a rotation? Is W=0 and the x,y,z the orientation?
Secondly, the vector3.Normalise() function returns a float... shouldnt it return a unit vector3? Am I looking at the wrong function?
I appreciate any light someone can shed on this - last couple of nights have been spent in frustration.
Thanks in advance,
Max
In other words, I want this mesh to "go forward".
I'm running into some problems - not the least of which is the realization that I need to read up on quaternions.
Quaternion q = shipNode.Orientation;
Is there an optimized way to convert q into a vector 3? Also, from my understanding Quaternions are defined as an axis and a rotation (w,x,y,z) - why would the orientation return a rotation? Is W=0 and the x,y,z the orientation?
Secondly, the vector3.Normalise() function returns a float... shouldnt it return a unit vector3? Am I looking at the wrong function?
I appreciate any light someone can shed on this - last couple of nights have been spent in frustration.
Thanks in advance,
Max