Archived

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

debo

Rotation About a Point *Newb Alert*

Recommended Posts

debo    122
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
azn_elliot    122
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