[vtkusers] VTK ActiViz to reset object to original view

Nick X. Tsui nickxtsui at gmail.com
Tue Dec 3 14:05:33 EST 2013


I am trying to reset the 3D object to its original view (something
orthogonal, sagital, say) after its interaction.

Here is my code how I try to reset, unsuccessful though:

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();
        }

How should I do this? Thanks a lot.


More information about the vtkusers mailing list