[vtkusers] Visible-surface determination

David Gobbi dgobbi at irus.rri.ca
Tue Jun 18 17:17:35 EDT 2002


Hi Simon,

The opacity is what is causing the problem.  The depth buffer method
that OpenGL (and most graphics toolkits) use to figure out which object
are in front of other objects does not work properly unless everything
in the scene is opaque.

The solution is to make sure that polygons are rendered back to front,
so that the rendering does not have to rely on the depth buffer.  The
vtkDepthSortPolyData filter can sort the polygons in an actor
back-to-front, but this only works if you have only one transparent
actor in the scene.

If you have more than one transparent actor, then each time you render
you have to remove all the actors from the renderer, and then add them
back to the renderer in back-to-front order.

 - David

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

On Tue, 18 Jun 2002, Simon Faust wrote:

> Hi David,
> thanks for your help. When I try to call ResetCameraClippingRange,
> nothing seems to happen. Only when I try to set the clipping range
> manually the effect disappears. The objects of the foreground (roof) are
> rendered, but as they were located in the background, i.e. the faces of
> the roof that are not covered by the floor (that actually should be
> covered by the roof) are displayed. Another aspect might be that the
> effect does not occur when opacity is set to1 (still testing that).
> ciao Simon
>
> David Gobbi wrote:
>
> >Hi Simon,
> >
> >The problem is probably not that the floor 'jumps in front of' the
> >roof, it is more likely that the roof is positioned in front of the
> >near clipping plane and is not being rendered.
> >If you do a ResetCameraClippingPlanes before each render the problem
> >should go away (as long as roof does not end up behind the camera).
> >
> >Cheers,
> > - David
> >
> >--
> >  David Gobbi, MSc                       dgobbi at irus.rri.ca
> >  Advanced Imaging Research Group
> >  Robarts Research Institute, University of Western Ontario
> >
> >On Tue, 18 Jun 2002, Simon Faust wrote:
> >
> >>Hi,
> >>I use vtkTkRenderWidget in order to display several objects that
> >>alltogether form a building with some installations in it. Problem ist
> >>that objects that should not be visible (i.e. the floor of a room when
> >>your viewpoint is over the roof) "jump" into the foreground and overlay
> >>objects that should be visible. The error occurs when rotating or
> >>zooming around/in the scene. Any hints welcome.
> >>Simon
> >>
> >>
> >>_______________________________________________
> >>This is the private VTK discussion list.
> >>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> >>Follow this link to subscribe/unsubscribe:
> >>http://public.kitware.com/mailman/listinfo/vtkusers
> >>
> >
> >
> >
>
>




More information about the vtkusers mailing list