Jump to content
  • Advertisement


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


What's the deal with this?

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

I just want to have a simple object move in the same direction as it''s facing. Someone HAS to know how to do this!!! Please help. D3DXMATRIX matRotation,matTrans,matScale; D3DXMatrixScaling( &matScale, 0.1f, 0.1f, 0.1f ); D3DXMatrixTranslation( &matTrans, mesh.vPos.x, mesh.vPos.y, mesh.vPos.z); D3DXMatrixRotationYawPitchRoll(&matRotation,mesh.fYaw,mesh.fPitch,mesh.fRoll); D3DXMatrixMultiply( &mesh.matLocal, &matRotation, &matScale); D3DXMatrixMultiply( &mesh.matLocal, &matTrans, &mesh.matLocal); mesh.vDir.x = mesh.matLocal._31; mesh.vDir.y = mesh.matLocal._32; mesh.vDir.z = mesh.matLocal._33; mesh.vPos += mesh.vDir * mesh.fSpeed; g_pd3dDevice->SetTransform( D3DTS_WORLD, &mesh.matLocal); ////////// * draw object here * ///////////} D3DXMATRIX matIdentity; D3DXMatrixIdentity(&matIdentity); g_pd3dDevice->SetTransform( D3DTS_WORLD, &matIdentity);

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!