How to specify point around which to rotate object ?
im using following directx functioms
to move object:
D3DXMatrixTranslation( &m, lpvMovement->x, lpvMovement->y, lpvMovement->z );
mat *= m;
to rotate object:
D3DXMatrixRotationYawPitchRoll( &m, lpvRotation->x, lpvRotation->y, lpvRotation->z );
mat *= m;
lpvRotation points to vector that specifies how much to rotate.lpvMovement points to vector that specifies how much to move.
later, before object is to be rendered im using mat matrix to set its
pDev3d->SetTransform( D3DTS_WORLD, &mat );
lpcMesh->Render( pDev3d );
how to put together this + rotation around specified point?
Please log in or register to post a reply.
To rotate around a specified point p, you need to first translate by -p
(this places p at the origin); then do the rotation; then translate by p
(this moves the object back to where it was originally). Then you can
continue with the other translation.
thanks, this clears things for me a bit