Nightly : BackFace/Frontface bug ?

Matthew Hall mahall at math.uiuc.edu
Sat Oct 9 18:33:02 EDT 1999


 >From owner-vtkusers at gsao.med.ge.com  Sat Oct  9 10:50:39 1999
 >X-UIDL: 19a5e5ed51c6f2996637cf9d1fa95787
 >X-Authentication-Warning: gsao.gso.med.ge.com: mjordomo set sender to owner-vtkusers at gsao.med.ge.com using -f
 >From: "Ron Inbar" <rinbar at netvision.net.il>
 >To: "John Biddiscombe" <j.biddiscombe at rl.ac.uk>, <vtkusers at gsao.med.ge.com>,
 >        "Bill Lorensen" <wlorens1 at nycap.rr.com>
 >Subject: Re: Nightly : BackFace/Frontface bug ?
 >Date: Fri, 8 Oct 1999 20:20:15 +0200
 >MIME-Version: 1.0
 >Content-Transfer-Encoding: 7bit
 >X-Priority: 3
 >X-MSMail-Priority: Normal
 >X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
 >
 >OpenGL culls polygons in all three modes: GL_FILL, GL_LINE and GL_POINT.  If
 >VTK renders wireframes using glPolygonMode(GL_FRONT_AND_BACK, GL_LINE), face
 >culling should work.  In this case there must be some VTK code that disables
 >face culling in wireframe mode.  Or perhaps VTK renders wireframes as a
 >bunch of lines rather than polygons.  This, however, doesn't seem to make
 >much sense when using OpenGL.
 >
 >Ron
 >
 >----- Original Message -----
 >From: Bill Lorensen <wlorens1 at nycap.rr.com>
 >To: John Biddiscombe <j.biddiscombe at rl.ac.uk>; <vtkusers at gsao.med.ge.com>
 >Sent: Friday, October 08, 1999 04:12
 >Subject: Re: Nightly : BackFace/Frontface bug ?
 >
 >
 >> John,
 >>          I think its an OpenGL thing, unless someone out there knows how
 >to do it.
 >> Bill
 >>
 >> At 01:36 AM 10/8/99 +0100, John Biddiscombe wrote:
 >> >Dear vtk'ers
 >> >
 >> >Nightly release
 >> >
 >> >When an actor has rendering = surface, backface and frontface culling
 >work
 >> >as expected. When rendering = wireframe, no culling occurs (either front
 >or
 >> >back).
 >> >
 >> >Not sure if this is a bug or an OpenGL "feature", but I don't see why
 >> >culling shouldn't work in wireframe mode.
 >> >
 >> >This bug has not appeared overnight, but I wasn't sure about it
 >before....
 >> >
 >> >John B
 >> >(apologies if this isn't a bug).
 >>
 >>
 >>
 >>
 >> --------------------------------------------------------------------------
 >---
 >> 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.
 >> --------------------------------------------------------------------------
 >---
 >>
 >>
 >
 >
 >
 >-----------------------------------------------------------------------------
 >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.
 >-----------------------------------------------------------------------------
 >

Having way too intimate an acquaintance with the OpenGL PolyDataMapper,
I can say that VTK does draw it's own wireframes, and does not use
OpenGL's polygon modes. (VTK also draws its own points, as well).
I imagine this to be for speed, but it causes problems when it comes
to culling, and also leads to trouble if you want a lit wireframe (or
aren't sure how to turn lighting off).

An untried hack, which may not work, would be to have VTK draw surfaces,
and call glPolygonMode(GL_FRONT_AND_BACK,GL_LINE) somewhere else. 
Seemingly, none of the vtkOpenGL classes actually sets the polygon mode
(relying on the default surface mode), so you can set this at your will.
Unfortunately, this is global, so you can't selectively draw wireframes.
It doesn't seem like you can do anything clever with SetStartMethod
either, as the mapper doesn't seem to do anything with StartMethod
(it _does_ call CheckAbortMethod, if you're desperate enough to sneak in
that way - so your CheckAbortMethod could set the polygon mode. But that
may be too clever by half)

-matt


-----------------------------------------------------------------------------
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