在我的代码中使用HelixToolkit
我有一个旋转矩阵(3x3),如:
UX VX WX
UY VY WY
UZ VZ WZ
我想旋转一个GeometryModel3D
. 我找到了RotateTransform3D
,我需要一个带角度的 Vector3D:
// Create and apply a transformation that rotates the object.
RotateTransform3D myRotateTransform3D = new RotateTransform3D();
AxisAngleRotation3D myAxisAngleRotation3d = new AxisAngleRotation3D();
**myAxisAngleRotation3d.Axis = new Vector3D(0, 3, 0);
myAxisAngleRotation3d.Angle = 40;**
myRotateTransform3D.Rotation = myAxisAngleRotation3d;
// Add the rotation transform to a Transform3DGroup
Transform3DGroup myTransform3DGroup = new Transform3DGroup();
myTransform3DGroup.Children.Add(myRotateTransform3D);
//ajoute the transformation to the model
model3D.Transform = myTransform3DGroup;
如何从我的旋转矩阵计算矢量和角度?