[vtkusers] Mesh visualization

Will Schroeder will.schroeder at kitware.com
Thu Jul 6 16:41:26 EDT 2000


Hi Patrick -

Amazing timing! Just today I was working on incorporating this capability 
into vtk. Bob Obara
at Simmetrix had come up with a solution using glDepthRange to shift the 
z-buffer. It seems
that you've found an alternative solution, maybe better.

Anyway, my thoughts were to add a flag into vtkPolyDataMapper to turn on 
this z-buffer
tweaking. Your right, only OpenGL is supported, but really that's all vtk 
uses at the moment.
If another renderer ever emerges we can add the function then.

Thanks for your feedback, I'll try and get it into vtk in the next couple 
of days.

Will

At 09:05 AM 7/5/2000 -0400, Patrick Lagace wrote:

>- Personnaly, I prefer using the openGL command  "glPolygonOffset" that 
>exists just for this
>kind of   polygon/wireframe interaction (it "bends" the polygon into the 
>z-buffer so that the
>polygon doesn't instersect the line when it is drawn... this is tricky to 
>explain but the
>result is visually flawless.)
>
>The drawbacks of this latter method is that it is... openGL only and is 
>not currently
>supported by VTK.  I've managed to trick VTK into using this openGL call 
>by subclassing a
>vtkDataSetMapper and using this modified mapper for my 
>vtkUnstructuredGrid.  This is a C++
>only hack and wont help in tcl.
>
>(the openGL calls into the ::Render(...) method are of the form:
>     glEnable(GL_POLYGON_OFFSET_FILL);
>     glPolygonOffset(1,1);
>
>     vtkDataSetMapper::Render(ren,act);
>
>     glDisable(GL_POLYGON_OFFSET_FILL);
>)
>
>good luck!
>
> >>>>note to the vtk team:  Is there any better way to do this?  This 
> "glPolygonOffset" call,
>is there any way that you could integrate it into the vtk package?  in 
>vtkOpenGLProperty
>maybe?
>





More information about the vtkusers mailing list