I am trying to implement rotation in my engine where rotation around the y-axis (yaw) occurs independent of previous rotations. In other words, if I rotate the pitch forward and the local up axis is now pointing in a different direction, I want my yaw rotation to occur as if the up axis was still in the same location. Here is a picture showing what I am looking to achieve:
[attachment=24245:Untitled-1.png]
Currently, for each object I am storing a persistent matrix that represents all of the translations and rotations that have occurred since it was created. Each frame, this matrix is incrementally updated.
My rotation code looks like this:
D3DXMatrixRotationYawPitchRoll(&rotation, yaw, pitch, roll);
D3DXMatrixMultiply(&position, &rotation, &position);
Position is the matrix that persists while the object exists that holds all the rotation and translation info.
This rotation code currently rotates yaw around the objects local y-axis, where I want it to rotate as if the y-axis was still pointing up (0,1,0).
How can I cause the rotation that I am looking for? (shown in the picture next to the check mark)