euler-angles

Is there a way to calculate 3D rotation on X and Y axis from a 4x4 matrix

时光总嘲笑我的痴心妄想 提交于 2019-11-26 17:12:05
问题 First of all, I am not a mathematical expert at all. Please be tolerant to my mathematical mistakes and correct me where necessary, I'd love to learn. I have a cube which is rotating using css animations with transform: matrix3d(4x4). I can also manually rotate the cube, converting user actions to the same matrix3d transformations. What I want is a rotating cube with css when the user stops interacting that starts from where the user left it. This is something I am successfully doing by

3D relative angle sum calculation

China☆狼群 提交于 2019-11-26 07:50:21
问题 I have a 3D object with rotation r1 in a quaternion form. I rotate it with local euler angles: transform.Rotate(new Vector3(0f, 15f, 0f), relativeTo: Space.Self); // right transform.Rotate(new Vector3(-10f, -5f, 0f), relativeTo: Space.Self); // left up transform.Rotate(new Vector3(0f, 0f, 90f), relativeTo: Space.Self); // 90 clockwise Now I have rotation r2 . How can I retrieve the local Y rotation sum 15-5+0=10 if I don\'t know what angles have been applied? It may be impossible to get