[vtkusers] Preset Views

Andres Barrera andresba at hotmail.com
Wed Sep 4 15:20:40 EDT 2002


Thanks Ted, this will be usefull for Daniele Bianchini too. Now she has two 
aproaches!

    Andres


>
>Andres,
>
>This is what am using, you can modify the values to suit.  Hope this
>helps.
>
>Ted
>
>////////////////////////////////////////////////////////////////////////////
>
>/////////////////////////////////////////////////////////////////////////////
>
>/////////////////////////////////////////////////////////////////////////////
>
>void CGraphicsView::OnViewLeft()
>{
>  double pdPosition[] = { -1,0,0 };
>  double dUp[] = { 0, 1, 0 };
>
>  vtkCamera *cam = Renderer->GetActiveCamera();
>
>  cam->SetFocalPoint(0,0,0);
>
>  pdPosition[0] =  -1;
>  pdPosition[1] =  0;
>  pdPosition[2] =  0;
>  dUp[0] = 0;
>  dUp[1] = 1;
>  dUp[2] = 0;
>  cam->SetViewUp(dUp);
>  cam->SetPosition(pdPosition);
>  cam->OrthogonalizeViewUp();
>
>  Renderer->ResetCamera();
>  Invalidate();
>
>}
>
>
>/////////////////////////////////////////////////////////////////////////////
>
>/////////////////////////////////////////////////////////////////////////////
>
>/////////////////////////////////////////////////////////////////////////////
>
>void CGraphicsView::OnViewIsometric()
>{
>  double pdPosition[] = { -1,0,0 };
>  double dUp[] = { 0, 1, 0 };
>
>  vtkCamera *cam = Renderer->GetActiveCamera();
>
>  cam->SetFocalPoint(0,0,0);
>
>  pdPosition[0] =  0;
>  pdPosition[1] =  0;
>  pdPosition[2] =  1;
>  dUp[0] = 0;
>  dUp[1] = 1;
>  dUp[2] = 0;
>  cam->SetViewUp(dUp);
>  cam->SetPosition(pdPosition);
>  cam->OrthogonalizeViewUp();
>  cam->Elevation(35.26);
>  cam->Azimuth(45);
>
>  Renderer->ResetCamera();
>  Invalidate();
>
>}
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




More information about the vtkusers mailing list