|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Converting onto XYZ from vector, need help.
Hello people.
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?. I'm stuck!. 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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
||||
|
||||
|
Take a look at this link.
http://mathworld.wolfram.com/EulerAngles.html You should have learned this stuff in school though.
__________________
There are none so blind as those who will not see. — Jonathan Swift My 2D Physics Engine. My Remake of UQM. Both are written in C#. |
|
#5
|
|||
|
|||
|
Quote:
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. This is important to bear in mind that trigonomic operations basically kill the CPU, looking up a predefined trigonomic value is much more efficient. |
|
#6
|
|||
|
|||
|
I think you might want to investigate quaternions
__________________
It's not always a matter of what you can do with a language, but whether you should. [JwD] |
|
#7
|
||||
|
||||
|
Quote:
I looked around and I couldn't find much on this subject. Would you be willing to post a link or 2 about this? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Game Development > Converting onto XYZ from vector, need help. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|