我正在尝试将3D对象重新设置为它的原始视图(例如,正交的,sagital )。
下面是我尝试重置的代码,但是没有成功:
private vtkAxesActor axes;
private vtkOrientationMarkerWidget widget;
public void ResetView()
{
// axes.InitPathTraversal();
if (axes != null)
{
if (axes.GetUserMatrix() != null)
axes.GetUserMatrix().Identity();
axes.GetMatrix().Identity();
axes.SetOrigin(0,0,0);
axes.SetOrientation(0, 0, 0);
axes.SetScale(1, 1, 1);
axes.SetPosition(0, 0, 0);
}
if (widget != null)
{
widget.SetOrientationMarker(axes);
}
ForceWindowToRender();
}我该怎么做?非常感谢。
发布于 2013-12-05 17:25:27
private vtkCamera camera;
camera.SetPosition(DoubleArrayToIntPtr(defaultCamPos));
camera.SetViewUp(DoubleArrayToIntPtr(defaultCamViewup));
camera.SetFocalPoint(DoubleArrayToIntPtr(defaultCamFocus));当然,您需要将焦点、位置和方向调整到您的感应器(参考VTK手册中的坐标系统),但这基本上就是在对象被旋转和移动之后,如何将3D呈现的对象设置为它的默认视图。
https://stackoverflow.com/questions/20359412
复制相似问题