Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualcathode26

Posted 03 May 2013 - 08:14 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;

#1cathode26

Posted 03 May 2013 - 08:11 PM

The actual solution...  I solved it..  This is how  you rotate properly in world space.

 

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;

PARTNERS