Jump to content
  • Advertisement

Archived

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

EagleWarrior

Yaw,Pitch,Roll, Translation matrix

This topic is 5966 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

Im using Directx to Move my Object and i have a problem my objects rotates Weird. Does it differ which Matrix i multiply first? MatoWorld=MatWorld*Translation MatWorld=MatWorld*MatPitch MatWorld=MatWorld*MatYaw MatWorld=MatWorld*MatRoll in this order only the Roll and Translation work fine but the other 2 end up rotating on the World Axis not the Axis i made I traced my axis Vecotors to see if the where moving with the object and they where. I tryed changing the order i multiply and tracing MatWorld i end up with diff matrices for each. They Supposed to be Equal but they aint. anyways thxs

Share this post


Link to post
Share on other sites
Advertisement
lol that didnt work either
heres my code


D3DXMATRIX matWorld,matTran;
D3DXMatrixTranslation(&matTran, m_oFighter.vPos.x, m_oFighter.vPos.y, m_oFighter.vPos.z);
D3DXMatrixMultiply( &matWorld, &matRoll, &matWorld );
D3DXMatrixMultiply( &matWorld, &matPitch, &matWorld );
D3DXMatrixMultiply( &matWorld, &matYaw, &matWorld );

matWorld=matWorld*matTran;

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Looks like you never setup the matWorld matrix before you start using it...I''m guessing you setup the yaw/roll/pitch right too..



D3DXMATRIX matWorld,matTran;

D3DXMatrixIdentity (&matWorld);
D3DXMatrixTranslation(&matTran, m_oFighter.vPos.x, m_oFighter.vPos.y, m_oFighter.vPos.z);
D3DXMatrixMultiply( &matWorld, &matRoll, &matWorld );
D3DXMatrixMultiply( &matWorld, &matPitch, &matWorld );
D3DXMatrixMultiply( &matWorld, &matYaw, &matWorld );
D3DXMatrixMultiply( &matWorld, &matTran, &matWorld );

Share this post


Link to post
Share on other sites
i fixed my problem i initilaized the local axis in the Frame Move function instead of the OneTimeInit so it kept changing the axis to its first coordinates. talk about dumb lol

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!