I rotate my turrets based of how the animation manager does is if it was exported with the animation. This works fine when there is no
turrets on top of another turret Like this image here. Its shooting at a target the main big turret is pointing at it but the small one on top is out. Ther small turret looks like its out by the amout the main turret is rotated to face target.
Any Ideas how to update my matrix now.
the turrets are pointing to the front of the vehicle when exported
and the small turrets base bone is linked to the main turrets base bone so it should be offset correct.
this is how Im doing it in code;
//make a rotation matrix D3DXMatrixRotationX(&mSpin, D3DXToRadian(TurretCurrentAngle[ctr])); //animation manager does this //Anim->m_Bone->TransformationMatrix *= mInvBindPose;// matRotation; D3DXMatrixIdentity(&temp); temp *= mSpin; temp *= FrameTurretBase[ctr]->TransformationMatrix; FrameTurretBase[ctr]->TransformationMatrix = temp; //end turret base //now do the elevation rotation axis is X elevation and Z Spin //make the elevation rotation D3DXMatrixRotationY(&mSpinElevation, D3DXToRadian(TurretCurrentElevationAngle[ctr])); D3DXMatrixIdentity(&temp); temp *= mSpinElevation; temp *= FrameTurretElevation[ctr]->TransformationMatrix; FrameTurretElevation[ctr]->TransformationMatrix = temp;// //end elevation ///////////////////////////////////////////////////////////////////////////////////////////////