I am trying to build a rotation calculation that is relative to the plane the object exist in. In my situation I can consider all objects to be independent rigid bodies. To further simplify my issues for this scenario all rotations are locked to the cardinal directions, i.e. all angles are locked to multiples of 90°.
For my system currently I am representing my rotation in 3 parts [Rx,Ry,Rz], where R? is rotation on the X,Y and Z directions respectively.
Currently for objects who sit on the absolute plane, i.e. they have a rotation of [0,0,0], I rotate the objects by just adding or subtracting 90° to the plane I want to move them. Although I fear this may be an oversimplification.
For objects not sitting on the absolute plane, i.e. they do not have a rotation of [0,0,0], I am having an issue to calculate the rotation relative to the plane it is in. So if we take an object with the initial rotation of [0,90,0] and I wanted to rotate it [90,0,0] relative to itself I know this has the end result of rotating it by [0,0,90]. Although this is the step I am stuck with transforming the relative values to absolute ones so that I can calculate them.
I am assuming some sort of matrix calculations would be involved although through my research I cannot find any examples that is simplistic enough to follow. Also I cannot shake the feeling that since I am locked to the cardinal directions there should be a way to reduce and simplify the problem.
Please could you either point me in the right starting point or suggest the names of methods I could look into?
See http://answers.google.com/answers/threadview/id/361441.html and also http://paulbourke.net/geometry/rotate/ as good starting points. (Bourke has lots of other good stuff, too.) Is this for programming (isn't it always:)? I used the above two pages (and several others, but the preceding contain all necessary info) to write the following C functions, based on quaternions,