Yaw,Pitch,Roll, Translation matrix
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
The order matters
Try Yaw, Pitch, Roll, Translation
Try Yaw, Pitch, Roll, Translation
Domini Miracle Man Studios
Roll, Yaw, Pitch, Translate.
Later,
ZE.
//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links
[if you have a link proposal, email me.]
EDITed for a nasty lil' error
[edited by - zealouselixir on March 19, 2002 11:30:30 PM]
Later,
ZE.
//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links
[if you have a link proposal, email me.]
EDITed for a nasty lil' error
[edited by - zealouselixir on March 19, 2002 11:30:30 PM]
[twitter]warrenm[/twitter]
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;
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;
Use this function to make your rotation matrix, instead of making a Yaw, pitch, and roll and then multiplying.
D3DXMatrixRotationYawPitchRoll
Domini
Rastagon 2 Engine
D3DXMatrixRotationYawPitchRoll
Domini
Rastagon 2 Engine
Domini Miracle Man Studios
March 20, 2002 08:03 AM
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 );
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 );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement