如何获取每个轴上的3D旋转角度?

5
我有一个Model3DGroup,它使用AxisAngleRotation3D应用于对象的Transform属性,绕任何x、y、z轴旋转。
问题是我无法控制网格上应用的各种旋转。我需要在每个渲染循环中显示网格在每个x、y、z轴上的角度。
我该怎么做?我尝试检索对象上的AxisAngleRotation3D对象,但它只给出了最后应用的旋转,这是不正确的。
例如,如果应用了旋转 轴:Vector3D(1,1,0) 角度:45
实际绕Z轴的旋转不会为0。我如何获得每个轴上的实际角度?
2个回答

2
 double rotationX = Vector3D.AngleBetween(new Vector3D(1, 0, 0), yourMatrix3D.Transform(new Vector3D(1, 0, 0)));
 double rotationY = Vector3D.AngleBetween(new Vector3D(0, 1, 0), yourMatrix3D.Transform(new Vector3D(0, 1, 0)));
 double rotationZ = Vector3D.AngleBetween(new Vector3D(0, 0, 1), yourMatrix3D.Transform(new Vector3D(0, 0, 1)));

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接