From: Olivier M. <Oli...@cy...> - 2000-09-13 06:48:46
|
Sven Goethel wrote: > Olivier Michel wrote: > > > > > > Sven, > > > > I seem to have understood the gluTesselator implementation you did since > > the tesselator demos works and are pretty clear to me. However, when > > I tryed my own tesselation system, it crashed hard. I am afraid I cannot > > give you my app as is because it's huge and requires a very heavy > > installation with clients / servers. However, I will try to make a > > simple example isolating the problem similar to the > > demos/MiscDemos/tess* that hopefully will exhibit the same crash, and > > give this demo to you (give me a few days). > > > > Thank you very much! > > > > It is a pleasure. > > Well, may be the "bug" will hopefully be fixed by yourself, > while creating the little example :-) > > I am waiting .. All right. I could not reproduce the bug in a simple example derivated from tess.java. However, I could fix it in my software. Anyway, something weird was happening, which might lie rather in GLU than in GL4Java. Actually I did two things which fixed the problem: 1) The tesselator crashed because the last point submitted was the same (i.e., same coords) as the first point and the GLU tesselator didn't liked that at all :(. So, before I submit points to the tesselator, I now check if the first one and the last one have the same coords and if this is the case, I do not submit the last one to the tesselator. Ok, this one might be understandable. 2) I removed the callback setup calls (gluTessCallback) from my GL initialization method (which creates the tesselator with gluNewTess and sets up all the GL stuff, like glEnable, glHint, glShadeModel, glPolygonMode, etc.) and moved them into the method that draws the tesselated polygon (just before calling gluTessBeginPolygon). This fixed the crashed in the native gluTessEndPolygon. This one is much weirder, isn't it ? I am using the GLU from SGI sample implementation on Linux whose tesselator is not (or less) bugged than the GLU tesselator coming with Mesa. If someone has any idea on why the bug (2) occured, I would be very happy to investigate it further. It might come from the fact, that in between calling my GL init method and the tesselated face drawing method, I call many other GLU functions (especially for drawing cylinders with quadrics). This might perturbate the GLU... I hope this could help others facing the same problem. -Olivier |