I look at the CMAttitude
basic motion CMAttitude
, it can express the device orientation as a 3x3 rotation matrix. At the same time, I looked at CATransform3D
, which encapsulates the attitude of the gaze as well as the scaling. CATransform3D
is a 4x4 matrix.
I saw that the OpenGL rotation matrix is 4x4 and just 0001 is complemented by a fourth row and column.
Am I wandering if the CMAttitude rotation matrix is related to the CATransform matrix?
Is it possible to use device rotation in the space obtained using the rotational matrix to convert the UIView using CATransform3D
? My intention is to let the user move the phone and apply it to the UIView on the screen.
Bonus question: if they are related, how do I convert the CMAttitude rotation matrix to CATransform3D?
source share