Re: [PyOpenGL-Users] GLU with multiple tesselators
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@ro...> - 2003-02-08 05:11:44
|
I haven't been ignoring this, just haven't figured out how to fix it yet (it is a PyOpenGL problem). Here is what's going on: Although each Tesselator is stored as an independent object, there are only 10 callback functions defined in the GLU wrapper. Each of these callbacks merely looks at the "currentTesselator" objects to determine what method to call currentTesselator is set by the input and output type-maps. I haven't yet figured out why this doesn't cause the "outer" tesselator's methods to get called... What I am considering doing is: * always using the "data" versions of the callback functions internally, * storing the externally-passed data value in the PyGLUTesselator object, * and passing a pointer to the tesselator object to the gluTessBeginPolygon method as the "data" pointer. When the callback triggers: * it will look at the tesselator pointer (the "data" pointer), * determine whether there is a real data value, * and determine whether there is a relevant callback. I had thought we got rid of all these callback problems more than a year ago, guess not. We'll probably need to check that the GLUT wrappers aren't suffering from similar problems. If one of the C programmers would like to step up and take this bug, I'd be happy to let them work on it, (hint, hint, all), if not, I'll probably work on it on Monday. Enjoy yourself, Maciej, and don't forget the PyGTA meeting on the 18th! Mike Maciej Kalisiak wrote: >[This has also been posted to comp.graphics.api.opengl, as I don't know whether > this is an OpenGL issue, or pyopengl.] > >Hello all. I'm trying to do some 2D CSG stuff using OpenGL's tesselator and >the winding rules. I've run into a problem with using multiple tesselators. >According to the redbook, I should be able to feed one tesselator's output >(using its callbacks) to the input of another one [midway on p421 of 2nd >ed... look for "GLU_TESS_BOUNDARY_ONLY"]. I tried to set up something along >those lines. Here's roughly what occurs at runtime: > >(NOTE: "outer" refers to actions taken on the "receiving" tesselator, while >"inner" refers to the "feeding" one) > >% ./test.py >outer: gluTessBeginPolygon <GLUtesselator object at 0x816c150> >inner: gluTessBeginPolygon <GLUtesselator object at 0x8121898> >inner: gluTessBeginContour <GLUtesselator object at 0x8121898> >inner: gluTessEndContour <GLUtesselator object at 0x8121898> >inner: gluTessEndPolygon <GLUtesselator object at 0x8121898> >inner: cb_begin <GLUtesselator object at 0x816c150> 2 >outer: gluTessEndPolygon <GLUtesselator object at 0x816c150> >Traceback (most recent call last): > File "./test.py", line 75, in ? > main() > File "./test.py", line 70, in main > gluTessEndPolygon(tobj) >OpenGL.GLU.GLUerror: [Errno 100154] gluTessEndContour() must follow a gluTessBeginContour() > >Strangely, gluTessEndPolygon() of the "feeding/inner" tesselator only fires the >GLU_TESS_BEGIN callback, and that's it! Bizarre. > >Here's the Python code for the above. All it's trying to do is tesselate a >circle using one tesselator, which then feeds the boundary (i.e., the same >circle, it should be) to a second tesselator. > >Any ideas? Did I miss something? I tried pyopengl 2.0.0.44, as well as >2.0.1.02. > > ... _______________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://members.rogers.com/mcfletch/ |