[vtkusers] How to intermix ray-casting volume and isosurfaces?
Sean McInerney
seanm at nmr.mgh.harvard.edu
Fri Mar 19 18:32:15 EST 2004
Short answer: What you want does not work with translucent geometry.
Full (hopefully correct) answer:
As far as I understand these facilities, what you are doing should work
for the very reason that the geometry is rendered before the ray casting
starts. This way, traversal of the ray through the volume data can be
terminated upon encountering the geometry surface as determined from the
z-buffer value at the given screen coordinate (when
IntermixIntersectingGeometry is "On"). However, if your geometry data is
not opaque, rendering it will not write the z-buffer data that
vtkVolumeRayCastMapper needs to do its thing. I am assuming some
knowledge of OpenGL and, therefore, what a z-buffer is ... forgive me if
this is less than enlightening, but your crap results may boil down to
use of translucent geometry ... an inherently tricky subject in real
time rendering.
There are a couple alternate routes IF the geometry is an isosurface
from the volume data being rendered: 1.) Put an opacity "spike" in your
opacity transfer function at the desired isovalue(s). 2.) Avoid
intermixing the geometry and volume data (stay with me here) and,
instead, crop away the volume where you wish to display the surface. You
might need to hack vtkFrustumCoverageCuller, so that it can pay
attention to where the cropped volume (as opposed to its whole extent)
is in the scene ... then set it to render back to front.
If you don't mind using FLTK, I have an example of what I describe above
included with vtkFLTK in Examples/Volume:
http://vtkfltk.sourceforge.net/
-Sean
>
> Hi,
>
> Do you know how to intermix a ray-casting volume and an isosurface?
> Both actor and volume are shown, but the actor is ALWAYS rendered
> before the volume, so it doesn't look properly intermixed.
>
> I am calling vtkVolumeRayCastMapper->IntermixIntersectingGeometryOn()
> function, but it doesn't work.
>
> Any ideas? Thanks in advance.
>
> Cristian
>
> __________________________________________________________
>
> Cristian J. Luciano
> Research Computer Scientist
>
> Electronic Visualization Laboratory
> Industrial Virtual Reality Institute
>
More information about the vtkusers
mailing list