Are CMAttitude and CATransform3D related by rotational matrices?
- by Alex Stone
I'm looking at the core motion class CMAttitude, it can express the device's orientation as a 3x3 rotational matrix. At the same time I've taken a look at the CATransform3D, which encapsulates the view's attitude, as well as scaling. The CATransform3D is a 4x4 matrix.
I've seen that the OpenGL rotational matrix is 4x4 and is simply 0001 padded in the 4th row and column.
I'm wandering if the CMAttitude's rotational matrix is related to CATransform's matrix?
Can I use the device's rotation in space obtained via a rotational matrix to transform a UIView using CATransform3D? My intention is to let the user move the phone and apply the same transform to a UIView on the screen.
Bonus question: if they are related, how do I transform a CMAttitude's rotational matrix to CATransform3D?