<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>And thinking about it: "The difference with yours is the offset is applied on a different coordinate system."<br><br>So the final epsilon is influenced by the invVolumeMatrix... and this should not be the case in my humble opinion (granted that we have only to overcome floating point inaccuracy).....<br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">Da:</span></b> AGPX <agpxnet@yahoo.it><br><b><span style="font-weight: bold;">A:</span></b> Francois Bertel <francois.bertel@kitware.com>; VTK Developers <vtk-developers@vtk.org><br><b><span style="font-weight: bold;">Inviato:</span></b> Gio 12 agosto
 2010, 23:46:31<br><b><span style="font-weight: bold;">Oggetto:</span></b> Re: [vtk-developers] vtkOpenGLGPUVolumeRayCastMapper fixes: the file.<br></font><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><div>>> "After clipping, the convex polyhedra should not be clipped by frustum planes"<br><br>ahem, I mean: "...not be clipped by near frustum plane..." :)<br> </div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">Da:</span></b> AGPX <agpxnet@yahoo.it><br><b><span style="font-weight: bold;">A:</span></b> Francois Bertel <francois.bertel@kitware.com>; VTK Developers <vtk-developers@vtk.org><br><b><span style="font-weight: bold;">Inviato:</span></b> Gio 12 agosto 2010, 23:43:00<br><b><span style="font-weight:
 bold;">Oggetto:</span></b> Re: [vtk-developers] vtkOpenGLGPUVolumeRayCastMapper fixes: the
 file.<br></font><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><div>Yes, looks like that yours offset works fine too. However, in a dataset I use I have a range of about 1300. So you shift the plane of about 1.3 unit and this could be too much. Actually we only need to overcome floating point inaccuracy (theoretically the exact near plane is the plane you have to clip with), thus 1.0e-3 could be sufficient for any application. After clipping, the convex polyhedra should not be clipped by frustum planes in the hardware pipeline, but instead this still occurs if you don't push the near plane a bit ahead.<br>The value 1.0e-3 could be too much if the range is < 1.0 (not likely, but possible). One can use the following then:<br><br>double eps=min(range/1000.0, 1.0e-3);<br><br>- AGPX<br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size:
 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">Da:</span></b> Francois Bertel <francois.bertel@kitware.com><br><b><span style="font-weight: bold;">A:</span></b> VTK Developers <vtk-developers@vtk.org><br><b><span style="font-weight: bold;">Inviato:</span></b> Gio 12 agosto 2010, 21:12:15<br><b><span style="font-weight: bold;">Oggetto:</span></b> Re: [vtk-developers] vtkOpenGLGPUVolumeRayCastMapper fixes: the file.<br></font><br>Hi AGPX,<br><br>for the second bug about the near clipping plane and the offset, I had<br>actually some code I was working on. The difference with yours is the<br>offset is applied on a different coordinate system.<br><br>Can you try this on your dataset (my offsets instead of yours), and<br>tell me if it fixes the visual defect or not?<br><br>I'm still debating about which one is the correct one.<br><br><br>>  
 double range=camWorldRange[1]-camWorldRange[0];<br>>   double eps=range/1000.0;<br>><br>3420,3422c3423,3425<br><   camNearWorldPoint[0] = camWorldPos[0] +<br>camWorldRange[0]*camWorldDirection[0];<br><   camNearWorldPoint[1] = camWorldPos[1] +<br>camWorldRange[0]*camWorldDirection[1];<br><   camNearWorldPoint[2] = camWorldPos[2] +<br>camWorldRange[0]*camWorldDirection[2];<br>---<br>>   camNearWorldPoint[0] = camWorldPos[0] + (camWorldRange[0]+eps)*camWorldDirection[0];<br>>   camNearWorldPoint[1] = camWorldPos[1] + (camWorldRange[0]+eps)*camWorldDirection[1];<br>>   camNearWorldPoint[2] = camWorldPos[2] + (camWorldRange[0]+eps)*camWorldDirection[2];<br><br>On Thu, Aug 12, 2010 at 12:56 PM, AGPX <<a rel="nofollow" ymailto="mailto:agpxnet@yahoo.it" target="_blank" href="mailto:agpxnet@yahoo.it">agpxnet@yahoo.it</a>> wrote:<br>> Hi,<br>><br>> to speedup the patching process, I have
 attached to this email the
 file<br>> vtkOpenGLGPUVolumeRayCastMapper.cxx with my fixes (and with the slight<br>> modification done by Francois Bertel that check if the volume box have no<br>> points). You can search for all the modifications by finding the string<br>> "AGPX MODIFIED".<br>><br>> - AGPX<br>><br>><br>><br>> _______________________________________________<br><span>> Powered by <a rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a></span><br>><br>> Visit other Kitware open-source projects at<br>> <a rel="nofollow" target="_blank" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>><br>> Follow this link to subscribe/unsubscribe:<br>> <a rel="nofollow" target="_blank" href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>><br>><br>><br><br><br><br>--
 <br>François Bertel, PhD  | Kitware Inc. Suite
 204<br>1 (518) 371 3971 x113 | 28 Corporate Drive<br>                      | Clifton Park NY 12065, USA<br>_______________________________________________<br><span>Powered by <a rel="nofollow" target="_blank" href="http://www.kitware.com">www.kitware.com</a></span><br><br>Visit other Kitware open-source projects at <a rel="nofollow" target="_blank" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Follow this link to subscribe/unsubscribe:<br><a rel="nofollow" target="_blank" href="http://www.vtk.org/mailman/listinfo/vtk-developers">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br><br></div></div>
</div><br>



      </div></div>
</div><br>



      </div></div>
</div><br>



      </body></html>