Translation along the same dir as you're facing
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);
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement