January 25th, 2007, 01:27 AM
Converting onto XYZ from vector, need help.
I have a vector that defines a rotation in degrees.
I must transform this onto XYZ (supposedly: world) so I can properly apply an impulse using a physics engine.
How can I do this?.
Shorter question: How can I transform a vector onto XYZ components, if the vector defines a rotation angle in degrees.
My vector magnitude is used as a "power" multiplier for the final impulse, I think this can be left alone on the actual computation of the XYZ components.
Thanks in advance
January 25th, 2007, 02:35 AM
I forgot to add: I'm using SIN and COS right now, however I was seeking for a more optimized solution. Sorry for not adding this on the original post.
I hope I'm making some sense here.
February 3rd, 2007, 09:57 PM
if you are using cyclidrical coordinates, R = length and W (theta) = angle
then X (or adjacent angle) = R Cos W
and Y (or opposite angle) = R Sin W
If you are using spherical coordinates it is different
February 4th, 2007, 04:07 PM
March 2nd, 2007, 08:52 AM
If you plan on using a matrix to transform the vector using trigonomic operations, its HIGHLY recommended that you create something known as a Trigonomic Lookup Table, which contains basically an array of floating point numbers containing the results of a sin or cosine operation. Then the only magic is figuring out how the shift the array access index by 1/4 that of a full circle.
Originally Posted by BioSlayer
This is important to bear in mind that trigonomic operations basically kill the CPU, looking up a predefined trigonomic value is much more efficient.
March 15th, 2007, 08:16 PM
I think you might want to investigate quaternions
I no longer wish to be associated with this site.
March 17th, 2007, 04:56 PM
I looked around and I couldn't find much on this subject. Would you be willing to post a link or 2 about this?
Originally Posted by MassKiller