This is what I want:
What am I doing wrong with the following code. The output of the translation for the orbit rotation never occurs, it just ends up rotating all on the original axis.
void Renderer::UpdateAsteroid( Placement^ asteroidRotation, Placement^ sceneOrientation )
{
XMMATRIX selfRotation;
// Rotate the asteroid
selfRotation = XMMatrixRotationX( asteroidRotation->GetRotX() );
selfRotation = XMMatrixMultiply( selfRotation, XMMatrixRotationY( asteroidRotation->GetRotY() ) );
selfRotation = XMMatrixMultiply( selfRotation, XMMatrixRotationZ( asteroidRotation->GetRotZ() ) );
XMMATRIX translation;
// Move the asteroid to new location
translation = XMMatrixTranslation( sceneOrientation->GetPosX(), sceneOrientation->GetPosY(), sceneOrientation->GetPosZ() );
XMMATRIX orbitRotation;
// Rotate from moved origin
orbitRotation = XMMatrixRotationZ( sceneOrientation->GetRotZ() );
XMMATRIX outputMatrix = selfRotation * translation * orbitRotation;
// Store
XMStoreFloat4x4( &m_constantBufferData.model, XMMatrixTranspose( outputMatrix ) );
}
but it does not seem to work.. it just ends up rotating on the same point.