Archived

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

Yaw,Pitch,Roll, Translation matrix

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