[vtkusers] Three vtkRenderer in one vtkRenderWindow

Chunyan Jiang jiang at TI.FhG.DE
Tue Jan 28 10:41:13 EST 2003


-----Ursprüngliche Nachricht-----
Von: vtkusers-admin at public.kitware.com
[mailto:vtkusers-admin at public.kitware.com]Im Auftrag von Chunyan Jiang
Gesendet: Freitag, 24. Januar 2003 10:10
An: VTK-User
Betreff: [vtkusers] Three vtkRenderer in one vtkRenderWindow


Hi, everybody,
My aim is to render three objects in the different part of one window and
interact on them together.
So I set one camera to these three vtkRenderer. It works now. However, I
still have one question. In order to explain my question clear, I name the
vtkRenderer as ren1, ren2, ren3. There is one special vtkRenderer which is
quite different with the others. I name it as ren1. When I put mouse in the
area of ren1 and click the left button, they will rotate together. It is ok.
However, when I put the mouse in the ren2 or ren3 and click the left button,
they will also rotate, but the ren1's object will be cliped badly, the other
two rens' will not. I guess that it maybe because the camera's near plane
and far plane. But why does it not effect the other two objects? Why has the
vtkRenderWindowInteractor different effect in different render area?
I hope some one could do me a favor and giving me one hint. Thanks a lot!
The following is the part of my code.

	renWin=vtkRenderWindow::New();
      iren = vtkRenderWindowInteractor::New();
      iren->SetRenderWindow(renWin);
	Camera = vtkCamera::New();
      Camera->SetPosition(0,0,-100  );
      Camera->SetFocalPoint( 0,0,0 );
	Camera->SetThickness(2000);
      Camera->Dolly(0.15);

	ren1=vtkRenderer::New();
	ren2=vtkRenderer::New();
	ren3=vtkRenderer::New();
	renWin->AddRenderer(ren1);
	renWin->AddRenderer(ren2);
	renWin->AddRenderer(ren3);
	ren1->SetActiveCamera(Camera);
	ren2->SetActiveCamera(Camera);
	ren3->SetActiveCamera(Camera);
	ren1->SetViewport(0.5,0,1.0,1.0);
	ren2->SetViewport(0,0,0.5,0.5);
	ren3->SetViewport(0,0.5,0.5,1);

	iren->SetRenderWindow(renWin);
	iren->Start();
	renWin->Render();

...


Chunyan
***********************************************************************
Chunyan Jiang, Dipl.-Inform.,
Institut for Telematic
Bahnhofstrasse 30-32, D-54292 Trier, Germany
Phone: (+49) (0)651-97551-34
Fax: (+49) (0)651-97551-12
***********************************************************************

_______________________________________________
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




More information about the vtkusers mailing list