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


What's the deal with this?

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