<div class="gmail_extra">Was doing it already in my real code (forgot it in the example). </div><div class="gmail_extra"><br></div><div class="gmail_extra">s.<br><br><div class="gmail_quote">On Mon, Apr 30, 2012 at 12:12 PM, Jothybasu Selvaraj <span dir="ltr"><<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Try adding <br><br>renWin->SetNumberOflayers(2)<br><br>before adding renderers to renWin.<br><br><br>
Jothy<br><br><div class="gmail_quote"><div><div class="h5">On Mon, Apr 30, 2012 at 5:06 PM, Simon Drouin <span dir="ltr"><<a href="mailto:drouin.simon@gmail.com" target="_blank">drouin.simon@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Trying to get the pick position from the first of 2 overlapping renderers doesn't work. Here is an example:<div>
<br>
</div><div><div><font face="'courier new', monospace">vtkRenderer * ren0 = vtkRenderer::New();</font></div>
<div><font face="'courier new', monospace">ren0->SetLayer( 0 );</font></div><div><font face="'courier new', monospace">vtkRenderer * ren1 = vtkRenderer::New();</font></div><div><font face="'courier new', monospace">ren1->SetLayer( 1 );</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">vtkRenderWindow * win = vtkRenderWindow::New();</font></div><div><font face="'courier new', monospace">win->AddRenderer( ren0 );</font></div>
<div><font face="'courier new', monospace">win->AddRenderer( ren1 );</font></div><div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">......</font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace">vtkPropPicker * picker = vtkPropPicker::New();</font></div><div><font face="'courier new', monospace">picker->Pick( x, y, z, ren0 );</font></div>
<div><font face="'courier new', monospace">double pos[3];</font></div><div><font face="'courier new', monospace">picker->GetPickPosition( pos );</font></div></div><div><font face="'courier new', monospace"><br>
</font></div>Here, pos will be wrong. The reason seems to be that GetPickPosition() relies on the content of the z buffer, but the z buffer generated by the first renderer is being cleared when the second renderer gets rendered.<div>
<br></div><div>Anybody has a workaround for that?</div><span><font color="#888888"><div><br></div><div>s.</div>
</font></span><br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</font></span></div>
</blockquote></div><br></div>