Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


Member Since 21 Apr 2006
Offline Last Active Jun 09 2013 04:03 PM

#5059063 Rotation in a sub node.

Posted by cathode26 on 03 May 2013 - 08:11 PM

The actual solution...  I solved it..  This is how  you rotate properly in world space.  If you look closely I had switched the order of the multiplication during the calculation of the world transform.


D3DXMATRIX worldRotation(*(node->rn_worldMatrix));
D3DXMATRIX worldTranslation; D3DXMatrixIdentity(&worldTranslation);
worldTranslation(3,0) = worldRotation(3,0);  
worldTranslation(3,1) = worldRotation(3,1);  
worldTranslation(3,2) = worldRotation(3,2);

worldRotation(3,0) = 0;
worldRotation(3,1) = 0;
worldRotation(3,2) = 0;

D3DXMATRIX worldTransformation = worldRotation*rotationMat*worldTranslation;
localTransformation = worldTransformation*parentInverseWorld;