<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>
&nbsp;<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>
&nbsp;<BR>
On 1/9/08, <B>Chuck Anderson</B> &lt;cda10@psu.edu&gt; 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> &lt;lplavorante@gmail.com&gt; wrote: <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Hi Mark,<BR>
I have used the &quot;ren2-&gt;SetActiveCamera(ren1-&gt;GetActiveCamera())&quot; 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 &quot;perfectly alligned&quot; 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>
&nbsp;&nbsp;&nbsp;&nbsp;Luca <BR>
<BR>
<BR>
<BR>
On Jan 9, 2008 4:09 PM, Mark Wyszomierski &lt; markww@gmail.com&gt; 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>
&nbsp;&nbsp;&nbsp;&nbsp;ren2-&gt;SetActiveCamera(ren1-&gt;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 &lt; siciliajudice@gmail.com &nbsp;<a href="mailto:siciliajudice@gmail.com">&lt;mailto:siciliajudice@gmail.com&gt;</a> &gt; wrote:<BR>
&gt; I think I am very near to finish this...<BR>
&gt;<BR>
&gt; Let me try to explain... I have to generate stereo images to use with <BR>
&gt; Crystal Eyes... So, I have create two viewports, displayed vertically, one <BR>
&gt; over other... The upper viewport is the stereo image for one eye, and the<BR>
&gt; second one for the other eye. I have to put one of this images with a <BR>
&gt; difference of 5&deg; (the paralaxe). I was creating two cameras, each one for <BR>
&gt; one viewport. In the second camera I was using the method Azimuth(5). But in<BR>
&gt; this way, I was having to take care of the interaction, what I could not <BR>
&gt; done... Now I have try a different solution: I create only one camera and <BR>
&gt; set to both viewports. Now, any action with the mouse move the two images<BR>
&gt; together... But I have to translate the second image in 5&deg;, and I do not <BR>
&gt; know how to do it... How can I translate an imagem in a viewport??? <BR>
&gt;<BR>
&gt; ps.: sorry for the english, I am from Brazil!<BR>
&gt;<BR>
&gt; ps2.: thanks for the attention!!!<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt; On Jan 9, 2008 11:42 AM, Luca Pallozzi Lavorante &lt; &nbsp;lplavorante@gmail.com <a href="mailto:lplavorante@gmail.com">&lt;mailto:lplavorante@gmail.com&gt;</a> &nbsp;&gt;<BR>
&gt; wrote:<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt; &gt; Sicilia,<BR>
&gt; &gt; if you work in C++, let's say you have two viewports, with two<BR>
&gt; corresponding instances of vtkRenderer, ren1 and ren2. Say that you want to <BR>
&gt; modify ren2&acute;s camera according to whatever interaction you perform on ren1 <BR>
&gt; (via a vtkRenderWindowInteractor). The command to accomplish that is :<BR>
&gt; &gt;<BR>
&gt; &gt; ren2-&gt;SetActiveCamera(ren1-&gt;GetActiveCamera()); <BR>
&gt; &gt;<BR>
&gt; &gt; Hope this help<BR>
&gt; &gt;<BR>
&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Luca <BR>
&gt; &gt;<BR>
&gt; &gt; _______________________________________________<BR>
&gt; &gt; This is the private VTK discussion list.<BR>
&gt; &gt; Please keep messages on-topic. Check the FAQ at: <BR>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><BR>
&gt; &gt; Follow this link to subscribe/unsubscribe:<BR>
&gt; &gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><BR>
&gt; &gt;<BR>
&gt; &gt;<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt; --<BR>
&gt; ---------------------------------------------------------------------------<BR>
&gt; Sicilia Ferreira Judice <BR>
&gt; www.lncc.br/~sicilia <a href="http://www.lncc.br/%7Esicilia">&lt;http://www.lncc.br/%7Esicilia&gt;</a> <BR>
&gt; sicilia@lncc.br<BR>
&gt;<BR>
&gt; Laborat&oacute;rio Nacional de Computa&ccedil;&atilde;o Cientifica<BR>
&gt; Avenida Getulio Vargas, 333 - Quitandinha. <BR>
&gt; Petr&oacute;polis, RJ, Brasil - CEP: 25651-075.<BR>
&gt; Sala 1A-44 &nbsp;| Tel. +55 (24) 2233-6173 <BR>
&gt; Lab. Virtual | Tel. +55 (24) 2233-6098<BR>
&gt; _______________________________________________<BR>
&gt; This is the private VTK discussion list. <BR>
&gt; Please keep messages on-topic. Check the FAQ at:<BR>
&gt; <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><BR>
&gt; Follow this link to subscribe/unsubscribe:<BR>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><BR>
&gt;<BR>
&gt;<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>