[Math] Rotating a set of anges (pitch/yaw/roll) by another set of angles (pitch/yaw/roll)

3dmatricestrigonometry

I want to rotate a set of angles (pitch/yaw/roll) by another set of angles (pitch/yaw/roll). By using Google I only found information about rotating a vector by angles, which is not what I need.
Examples: (disregarding signs)

- (0/90/0) rotated by (90/0/0) -> (90/0/90)
- (0/0/90) rotated by (90/0/0) -> (90/90/0)

For simplicity I just created examples with angles of 90°, but I am looking for a method that can also do this with odd angles. What method works for this? Is this possible to do with rotation matrices?

Best Answer

This is a problem that 3D animation software has to deal with all the time, namely when an object's coordinate system is related to another object's coordinate system rather than the global coordinate system. In the general case, there may be arbitrarily many such coordinate systems each adding their own pitch/yaw/roll to each child object.

The solution used by Blender (https://www.blender.org) is based on Quaternions. Wikipedia explains how quaternions work in this case: https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation. That explanation is perhaps too lengthy to be copied here (though it can be if that's the only way to validly "answer" the question).

Related Question