Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

RavNaz

Couple of quickies...

This topic is 5452 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Guys, couple of questions I seek your aid with :-) Am converting an objects world velocity to object velocity and back again. Am using the following equation: Vx = cos(theta) * World_Vz + sin(theta) * World_Vx Vz = -sin(theta) * World_Vz + cos(theta) * World_Vx And to convert it back again I''m doing the same thing but replace Vx with World_Vx and vice versa. Anyone got the proof as to why this works?

Share this post


Link to post
Share on other sites
Advertisement
It looks like you are essentially multiplying your vectors by the 2x2 rotation matrix

cos(theta) sin(theta)
-sin(theta) cos(theta)

which rotates them into the local space of the matrix. The two rows of the matrix are orthogonal basis vectors in 2D, representing the local coordinate system of your object. If you don''t know about matrices already, you might be interested in learning about them, as they can speed up and make more elegant computations like the one you''re doing here (although in this case it wouldn''t make much difference). One good reference is "3D Math Primer" by Dunn and Parberry.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!