Hi guys. This is what I have done and it works correctly...
// get the current transformation matrix that we want to modify...
Matrix transform = _entity.AnimationController.SkinnedBoneTransforms[_boneIndex];
Vector3 translation = transform.Translation; //
save for later use...
// move the matrix down so we rotate around the base point correctly.
transform.Translation +=
new Vector3(0, translation.Y, 0);
// apply your transformations here. I’m rotating based on the pitch of the camera.
transform *=
Matrix.CreateFromYawPitchRoll(0, _entity.Game.Camera.Pitch, 0);
// move the matrix back up again...
transform.Translation =
new Vector3(0, translation.Y, 0);
// set the final transformation matrix...
_entity.AnimationController.SkinnedBoneTransforms[_boneIndex] = transform;
Hope this helps someone...
