Set/Get the points of view.

Hi all.
I want to save the specific position and magnification(focale?) in the 3D Viewer, and to see the shape in the 3D Viewer at the position and magnification that I saved when I wanted.

 

I did the following, but did not get the right result.

void 3d_viewer :: save_scene ()
{
   myView->Eye (m_eye_x, m_eye_y, m_eye_z);
   myView->Proj (m_pro_x, m_pro_y, m_pro_z);
   myView->At (m_at_x, m_at_y, m_at_z);
   m_focale = myView->Focale();
}

void 3d_viewer::load_scene()
{
   myView->SetEye (m_eye_x, m_eye_y, m_eye_z);
   myView->SetProj (m_pro_x, m_pro_y, m_pro_z);
   myView->SetAt (m_at_x, m_at_y, m_at_z);
   myView->SetFocale(m_focale);
}

How should I code it?

  

Kirill Gavrilov's picture

You can check source code of Draw Harness command vviewparams intended for this purpose.

eieihoho_140436's picture

Thank you. I solved it.