Are CMAttitude and CATransform3D related by rotational matrices?

Posted by Alex Stone on Stack Overflow See other posts from Stack Overflow or by Alex Stone
Published on 2012-06-01T16:29:42Z Indexed on 2012/06/01 16:41 UTC
Read the original article Hit count: 255

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ios