Jump to content
  • Advertisement
Sign in to follow this  
Kr00pS

[SOLVED] Join 2 matrix

This topic is 3969 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'm trying to make a car game. I have a player at the back of the car (first matrix: the car can rotate) who can rotate (twice matrix), the problem is that the player rotation isn't synchronized with the car rotation so how can I join the 2 matrix ? Some screens to illustrate my problem: Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us Thanks in advance. [Edited by - Kr00pS on February 2, 2008 10:09:51 AM]

Share this post


Link to post
Share on other sites
Advertisement
You need to concatenate the rotation matrices, but be sure that they are both relative to the same origin and axis. If the center of rotation of the character on the truck is different than that of the car, you will need to incorporate that difference into your concatenations.

The most API agnostic resource I can find at here and here.

Share this post


Link to post
Share on other sites
Thanks, it worked. :)

I used D3DXMatrixMultiply() function like this:

D3DXMatrixMultiply(&c, van->GetRotationMatrix(), &m_RotationMatrix);
m_Sprite->SetTransform(&c);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!