function switchToPlanMode() {
var state = navisViewer.viewer.State;
var camera = state.CurrentView.ViewPoint.Camera;
cameraPosition = camera.Position.Copy();
cameraRotation = camera.Rotation.Copy();
// create a geometry vector as the normal of section plane
var sectionPlaneNormal = state.ObjectFactory(state.GetEnum("eObjectType_nwLUnitVec3f"), null, null);
sectionPlaneNormal.SetValue(0, 0, -1);
// create a geometry plane
var sectionPlane = state.ObjectFactory(state.GetEnum("eObjectType_nwLPlane3f"), null, null);
//get collection of sectioning planes
var clipColl = state.CurrentView.ClippingPlanes();
// get the count of current sectioning planes
var planeCount = clipColl.Count + 1;
// create a new sectioning plane
// it forces creation of planes up to this index.
clipColl.CreatePlane(planeCount);
// get the last sectioning plane which are what we created
var cliPlane = state.CurrentView.ClippingPlanes().Last();
//assign the geometry vector with the plane
var z = camera.Position.data3;
sectionPlane.SetValue(sectionPlaneNormal, -z);
// ask the sectioning plane uses the new geometry plane
cliPlane.Plane = sectionPlane;
state.BeginEdit("Camera");
var x = camera.Position.data1;
var y = camera.Position.data2;
var rotationVector =
state.ObjectFactory(state.GetEnum("eObjectType_nwLUnitVec3f"), null, null);
rotationVector.SetValue(0, 0, -1);
camera.Rotation.SetValue(rotationVector, 0);
camera.Position.SetValue(x, y, z + 50);
// enable this sectioning plane
cliPlane.Enabled = true;
camera.Projection = state.GetEnum("eProjection_ORTHOGRAPHIC");
var viewPoint = state.CurrentView.ViewPoint;
viewPoint.Viewer.CameraMode = state.GetEnum("eCameraMode_ThirdPerson");
state.EndEdit();
//state.CurrentView.ViewPoint.Paradigm = state.GetEnum("eParadigm_PAN_LOCAL");
};