[vtkusers] Realtionship between camera and coordinate system

Wenlong Wang scc.wwl at gmail.com
Thu Nov 10 12:06:41 EST 2011


Dear all,

I'm using vtkCamera and vtkRenderer to convert points from world
coordinates to display coordinates.

I have two actors. I add these actors to my renderer one by one like
follows.
*
A  renderer->SetActiveCamera(camera1);
    renderer->AddActor(actor1);
    renderer->AddActor(actor2);
    camera2 = renderer->GetActiveCamera();
//-------------------------------------------------------------
B  renderer->SetActiveCamera(camera1);
    renderer->AddActor(actor1);
    camera2 = renderer->GetActiveCamera();
    renderer->AddActor(actor2);*

So, are the details of camera2 in case A and case B same? In my app, it is
not. Seems the camera always catch the center of 3D space and set its focal
point to it.

I am trying to make sure the camera always focus on actor1 even there are
more actors added to the renderer. I guess the code should be like this,

*renderer->AddActor(actor1);
camera = renderer->GetActiveCamer();
renderer->AddActor(actor2);
renderer->SetActiveCamera(camera);*

Am I right on this?

Thank you very much.

Best wishes
Long
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111110/f009c01e/attachment.htm>


More information about the vtkusers mailing list