[vtkusers] Top, bottom and side views of the scene

Carlos Martinez Burgos cmarbur at iti.upv.es
Thu Jul 12 11:24:41 EDT 2001


On Wed, 11 Jul 2001, Goodwin Lawlor wrote:

> See the UpdateView proc in decimate.tcl as an example
> 

OK, thanks. I have tried it and I have got good results. But I have a
problem. When I change the view I wish to get a full extent view, from the
side choosed. I have done this method, but I can't get it. Could you help
me?

    public void setPointOfView(int pointOfView) {
        Box bounds=visualization.getBoundingBox();
        Point p1=new Point(bounds.getLocation());
        Point p2=new Point(p1.getX()+bounds.getWidth(),
                           p1.getY()+bounds.getHeight(),
                           p1.getZ()+bounds.getDepth());
        Point c=bounds.getCenter();
        vtkCamera camera=renderer.GetActiveCamera();
        camera.SetFocalPoint(center.getX(),center.getY(),center.getZ());
        switch (pointOfView) {
            case LEFT_VIEW:
                camera.SetPosition(c.getX()-1,c.getY(),c.getZ());
                camera.SetViewUp(1,0,0);
                break;
            case RIGHT_VIEW:
                camera.SetPosition(c.getX()+1,c.getY(),c.getZ());
                camera.SetViewUp(1,0,0);
                break;
            case FRONT_VIEW:
                camera.SetPosition(c.getX(),c.getY()-1,c.getZ());
                camera.SetViewUp(0,1,0);
                break;
            case BACK_VIEW:
                camera.SetPosition(c.getX(),c.getY()+1,c.getZ());
                camera.SetViewUp(0,1,0);
                break;
            case TOP_VIEW:
                camera.SetPosition(c.getX(),c.getY(),c.getZ()-1);
                camera.SetViewUp(0,0,1);
                break;
            case BOTTOM_VIEW:
                camera.SetPosition(c.getX(),c.getY(),c.getZ()+1);
                camera.SetViewUp(0,0,1);
                break;
        }
        camera.SetParallelProjection(1);
        renderer.ResetCamera(p1.getX(),p2.getX(),
                             p1.getY(),p2.getY(),
                             p1.getZ(),p2.getZ());
        axes.update();
    }

Box and Point are classes that I have defined. How can I do it?

Thanks.

> ----- Original Message -----
> From: "Carlos Martinez Burgos" <cmarbur at iti.upv.es>
> To: "VTK User Mailing List" <vtkusers at public.kitware.com>
> Sent: Wednesday, July 11, 2001 5:40 PM
> Subject: [vtkusers] Top, bottom and side views of the scene
> 
> 
> > Hi all.
> >
> > How can I use the camera to get orthogonal views from all the actors on
> > the scene? I want to get top, bottom and side views of all the actors.
> >
> > Thanks.
> >
> > --
> > ----------------------------------------------------------------------
> > Carlos Martínez Burgos      |     Instituto Tecnológico de Informática
> > Ingeniero Informático       |      Universidad Politécnica de Valencia
> > Tlf: +34 963877237          |                        Camí de Vera, S/N
> > cmarbur at iti.upv.es          |                   46071 Valencia - Spain
> > www.iti.upv.es/~cmarbur     |                           www.iti.upv.es
> > ----------------------------------------------------------------------
> >
> >
> > _______________________________________________
> > 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
> 

-- 
----------------------------------------------------------------------
Carlos Martínez Burgos      |     Instituto Tecnológico de Informática
Ingeniero Informático       |      Universidad Politécnica de Valencia
Tlf: +34 963877237          |                        Camí de Vera, S/N
cmarbur at iti.upv.es          |                   46071 Valencia - Spain
www.iti.upv.es/~cmarbur     |                           www.iti.upv.es
----------------------------------------------------------------------





More information about the vtkusers mailing list