<HTML>
<HEAD>
<TITLE>Re: [vtkusers] same camera on different viewpoints</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Silicia,<BR>
<BR>
Everything I do in VTK is for stereo viewing with a Crystal Eye compatible stereo projection system, so I know it works well. I work in Tkl/Tk so the syntax will different for you, but here are the three lines I include in the RenderWindow setup to get the stereo working:<BR>
<BR>
StereoCapableWindowOn<BR>
SetStereoTypeToCrystalEyes<BR>
StereoRenderOn<BR>
<BR>
VTK handles all the work arranging the 2 cameras etc. You can change the eye separation, but I find the default value works fine so I never change it.<BR>
<BR>
Cheers,<BR>
Chuck<BR>
<BR>
--------------------------------------<BR>
Chuck Anderson<BR>
Visualization and Outreach Specialist<BR>
Center for Environmental Kinetics Analysis (CEKA)<BR>
Penn State<BR>
2217 EES Building<BR>
814-863-2049<BR>
cda10@psu.edu<BR>
<BR>
<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Hi, Chuck...<BR>
<BR>
I am new in VTK... There is a way to use especific methods to Crystal Eyes in VTK? My goal is to make stereo images for Crystal Eyes. So, I display the same actor in two differents viewports, where each one has it owns camera... One camera I have to use the method Azimuth(5) to set the difference of the distance of the eyes... So, when I move the actor in one viewport, the other do not move together... I have to make this work! There is methods to Crystal Eyes already implemented??? <BR>
<BR>
<BR>
On 1/9/08, <B>Chuck Anderson</B> <cda10@psu.edu> wrote: <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>I just saw this thread and can not find the beginning...but is there some special reason that you can not use the Crystal eyes stereo capability built into RenderWindow? <BR>
<BR>
Chuck<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
On 1/9/08, <B>Luca Pallozzi Lavorante</B> <lplavorante@gmail.com> wrote: <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Hi Mark,<BR>
I have used the "ren2->SetActiveCamera(ren1->GetActiveCamera())" approach only on small test programs and I have got no crashes. On production applications the pair vtkOrientationMarkerWidget / vtkAxesActor was sufficient to me as I only needed a smaller viewport showing axes "perfectly alligned" with the object shown in the main viewport. <BR>
<BR>
It would be interesting to know if anybody on the list has had crash problems by sharing camera pointers among renderers.<BR>
<BR>
Luca <BR>
<BR>
<BR>
<BR>
On Jan 9, 2008 4:09 PM, Mark Wyszomierski < markww@gmail.com> wrote:<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Luca, I had tried that myself at one point: <BR>
<BR>
ren2->SetActiveCamera(ren1->GetActiveCamera()); <BR>
<BR>
but would get random crashes, has it been ok for you? I eventually had<BR>
to manually copy over camera parameters between the two cameras<BR>
instead to get the same effect. <BR>
<BR>
I think what Sicilia wants is to have the same interaction propagated <BR>
to all renderers (since the cameras may be setup in different<BR>
locations). This probably isn't a typical thing to do, normally you<BR>
want the camera location copied throughout all renderers instead. I<BR>
was looking into this but couldn't figure out myself how to Invoke() <BR>
the same interaction on another renderer. We can listen on Interaction<BR>
events on the render window's interactor, but not quite sure how to<BR>
propagate it to the other renderers.<BR>
<BR>
Mark<BR>
<BR>
<BR>
On Jan 9, 2008 8:52 AM, Sicilia Judice < siciliajudice@gmail.com <a href="mailto:siciliajudice@gmail.com"><mailto:siciliajudice@gmail.com></a> > wrote:<BR>
> I think I am very near to finish this...<BR>
><BR>
> Let me try to explain... I have to generate stereo images to use with <BR>
> Crystal Eyes... So, I have create two viewports, displayed vertically, one <BR>
> over other... The upper viewport is the stereo image for one eye, and the<BR>
> second one for the other eye. I have to put one of this images with a <BR>
> difference of 5° (the paralaxe). I was creating two cameras, each one for <BR>
> one viewport. In the second camera I was using the method Azimuth(5). But in<BR>
> this way, I was having to take care of the interaction, what I could not <BR>
> done... Now I have try a different solution: I create only one camera and <BR>
> set to both viewports. Now, any action with the mouse move the two images<BR>
> together... But I have to translate the second image in 5°, and I do not <BR>
> know how to do it... How can I translate an imagem in a viewport??? <BR>
><BR>
> ps.: sorry for the english, I am from Brazil!<BR>
><BR>
> ps2.: thanks for the attention!!!<BR>
><BR>
><BR>
><BR>
> On Jan 9, 2008 11:42 AM, Luca Pallozzi Lavorante < lplavorante@gmail.com <a href="mailto:lplavorante@gmail.com"><mailto:lplavorante@gmail.com></a> ><BR>
> wrote:<BR>
> ><BR>
> ><BR>
> ><BR>
> > Sicilia,<BR>
> > if you work in C++, let's say you have two viewports, with two<BR>
> corresponding instances of vtkRenderer, ren1 and ren2. Say that you want to <BR>
> modify ren2´s camera according to whatever interaction you perform on ren1 <BR>
> (via a vtkRenderWindowInteractor). The command to accomplish that is :<BR>
> ><BR>
> > ren2->SetActiveCamera(ren1->GetActiveCamera()); <BR>
> ><BR>
> > Hope this help<BR>
> ><BR>
> > Luca <BR>
> ><BR>
> > _______________________________________________<BR>
> > This is the private VTK discussion list.<BR>
> > Please keep messages on-topic. Check the FAQ at: <BR>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><BR>
> > Follow this link to subscribe/unsubscribe:<BR>
> > <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><BR>
> ><BR>
> ><BR>
><BR>
><BR>
><BR>
> --<BR>
> ---------------------------------------------------------------------------<BR>
> Sicilia Ferreira Judice <BR>
> www.lncc.br/~sicilia <a href="http://www.lncc.br/%7Esicilia"><http://www.lncc.br/%7Esicilia></a> <BR>
> sicilia@lncc.br<BR>
><BR>
> Laboratório Nacional de Computação Cientifica<BR>
> Avenida Getulio Vargas, 333 - Quitandinha. <BR>
> Petrópolis, RJ, Brasil - CEP: 25651-075.<BR>
> Sala 1A-44 | Tel. +55 (24) 2233-6173 <BR>
> Lab. Virtual | Tel. +55 (24) 2233-6098<BR>
> _______________________________________________<BR>
> This is the private VTK discussion list. <BR>
> Please keep messages on-topic. Check the FAQ at:<BR>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><BR>
> Follow this link to subscribe/unsubscribe:<BR>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><BR>
><BR>
><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
_______________________________________________<BR>
This is the private VTK discussion list.<BR>
Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><BR>
Follow this link to subscribe/unsubscribe:<BR>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
</SPAN></FONT>
</BODY>
</HTML>