Newbie question: Using OpenGL to enhance a VTK scene

David Gobbi dgobbi at irus.rri.on.ca
Wed Jul 14 13:44:28 EDT 1999


Hi Ron,

Recent versions of VTK (i.e. either 2.4 or the nightly releases)
are capable of applying arbitrary OpenGL clipping planes like so:

vtkPlane plane
plane SetNormal 1.0 0.0 0.0
plane SetOrigin 0.0 0.0 0.0

vtkDataSetMapper mapper
mapper SetInput [<something> GetOutput]
mapper AddClippingPlane plane

You will want to have two clipping planes with opposite normals,
one for the opaque portion of the scene and one for the translucent
portion (you can add a clipping plane to as many mappers as you want).

 - David

--David Gobbi, MSc                    dgobbi at irus.rri.on.ca
  Advanced Imaging Research Group
  Robarts Research Institute, University of Western Ontario

On Wed, 14 Jul 1999, Ron Inbar wrote:

> Hello everybody!
> 
> I want to use several OpenGL features to enhance my VTK scene.  
> Specifically, I want to use the OpenGL clipping planes to render the
> front of an object translucent while the back remains opaque.  I was
> planning to use a two-pass approach: first set the near clipping plane
> to a (continuously changing) distance d from the projection center and
> render the scene once with opacity 1.0.  Then set the far clipping plane
> to d, the near plane to, say, 0.01 * d, and render the scene again with
> opacity 0.5.  How can I implement such a procedure in VTK?
> 
> I am pretty much in the dark here; your help will be greatly appreciated.
> 
> Thanks in advance,
> 
> Ron
> 
> 




-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list