Archived

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

Translation along the same dir as you're facing

This topic is 6081 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''m doing something like this to move a plane mesh around my world. But something''s not right, the translation part is not working at all. The rotation part works just fine so how do i get the mesh to move in the same direction it''s facing. D3DXVECTOR3 vTrans = mesh.vVelocity * mesh.fSpeed; D3DXVec3TransformNormal( &vTrans, &vTrans, &mesh.matLocal); mesh.vPosition += vTrans; D3DXQUATERNION qR; D3DXQuaternionRotationYawPitchRoll( &qR, mesh.fYaw, mesh.fPitch, mesh.fRoll); D3DXMatrixAffineTransformation( &mesh.matLocal, .25f, NULL, &qR, &mesh.vPosition); g_pd3dDevice->SetTransform( D3DTS_WORLD, &mesh.matLocal);

Share this post


Link to post
Share on other sites