Hello everyone,<br><br>I'm actually working on a picking that don't draw all the objets of the scene but only the pickable objects. In fact my scene contains for example 400 actors of 4 types of datas. My user want to select only one type of data. But he wants to select only the actors visibles.<br>
<br>So to not draw all the actors on the pick rendering (i use vtkVisibleCellSelector for personnal implementation reason) I change a little VTK and I don't erase the z-buffer on the pick rendering. This permits to me to render only the actors pickable and to be sure that they are visible when all the actors are rendered.<br>
<br>This works when the selection area is a point. But when the selection area is a rectangle the z-buffer is reset to 0 and I don't know where. A developper of VTK could tell me where in the code the z-buffer is set to 0 and why ? (by default a clear z-buffer is equal to 1, the infinite, 0 is the near plan).<br clear="all">
<br>This is the key code that shows the setting 0 of the z-buffer (in java ) :<br><br>vtkFloatArray beforeNative = new vtkFloatArray();<br> canvas.GetRenderWindow().GetZbufferData(firstPoint[0], firstPoint[1], secondPoint[0], secondPoint[1], beforeNative);<br>
float[] before = beforeNative.GetJavaArray();<br> <br>// Making my picking<br><br>vtkFloatArray afterNative = new vtkFloatArray();<br> canvas.GetRenderWindow().GetZbufferData(firstPoint[0], firstPoint[1], secondPoint[0], secondPoint[1], afterNative);<br>
<br> float[] after = afterNative.GetJavaArray();<br> <br> System.out.println("Z-BUFFER : ");<br> for(int i = 0 ; i < before.length ; ++i)<br> {<br> System.out.println(before[i] + " -> " + after[i]);<br>
}<br><br>The output for a point selection :<br><br>Z-BUFFER : <br>0.37655056 -> 0.37655056<br><br>The output for a rectangle selection :<br><br>Z-BUFFER : <br>0.0 -> 0.4381339<br>0.0 -> 0.43666053<br>0.0 -> 0.43538022<br>
0.0 -> 0.4345476<br>0.0 -> 0.43371505<br>0.0 -> 0.43288243<br>0.0 -> 0.43204987<br>0.0 -> 0.43142706<br>0.0 -> 0.43115902<br>0.0 -> 0.43089098<br>0.0 -> 0.43062294<br>0.0 -> 0.4303549<br>0.0 -> 0.43019688<br>
0.0 -> 0.43046153<br>0.0 -> 0.43072623<br>0.0 -> 0.43099087<br>0.0 -> 0.43125558<br>0.0 -> 0.43152028<br>0.0 -> 0.43230826<br>0.0 -> 0.43310922<br>0.0 -> 0.4339102<br>0.0 -> 0.43471116<br>0.0 -> 0.43551213<br>
<br>Any suggestion ?<br><br>-- <br>Julian Ibarz