Jump to content
  • Advertisement

Archived

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

debo

Rotation About a Point *Newb Alert*

This topic is 5413 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, I currently am working on my first project in Direct X 9, the idea being that is a driving game. However I have come upon my first problem that is really bugging me. I so far a rudimentary movement function for the car and it seems to work fine, but for my wheels (which are rendered as four independent meshes) I cannot get them to rotate around the car. I have tried parametric equations for circular movement as such, xMove = cos( (2 * PI) * m_fElapsedTime); zMove = sin( (2 * PI) * m_fElapsedTime); Which keeps the wheels in the same postion in the X-Z plane, but I cannot get them to roate together aroudn the center of the car. I think part of the problem is that the ordering of the matrix multiplication is not right but it is hard since as far as i know you can only multiply two matrices together at one time within Direct X. Any help is greatly appreciated Debo

Share this post


Link to post
Share on other sites
Advertisement
I believe the order should be (considering everything is being drawn at the origin temporarily until translated as to where it should be) as to using matrices..

-Rotate each wheel (considering even the back wheels turn too)
-Translate them as to where they should be alligned with, under the car.
-Rotate the car and wheels
-Translate the car and wheels as to where it should be

Share this post


Link to post
Share on other sites
Thanks a lot, i have got it working now and it was the order of the mutiplication. Thanks mate

Debo

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!