Dear all,
I am having some problems with Jogl tesselation, I have been using it for a long time, but sometimes, the tesselation doesn’t give me the correct result.
For instance, if I want to get a contour (a union of two contours) with the rules glu.gluTessProperty(tessObj,GLU.GLU_TESS_WINDING_RULE,GLU.GLU_TESS_WINDING_NONZERO);
glu.gluTessProperty(tessObj, GLU.GLU_TESS_BOUNDARY_ONLY, GLU.GLU_TRUE);
[[Vec3: 11.0, 0.0, 0.0
, Vec3: 0.0, 0.0, 0.0
, Vec3: 0.0, 0.0, 2.0
, Vec3: 11.0, 0.0, 2
], [Vec3: 11.0, 0.0, 6.0
, Vec3: 11.0, 0.0, 2
, Vec3: 1.0, 0.0, 2
, Vec3: 1, 0.0, 6
]]
I will have the correct result that is :
[[Vec3: 11.0, 0.0, 2.0
, Vec3: 11.0, 0.0, 0.0
, Vec3: 0.0, 0.0, 0.0
, Vec3: 0.0, 0.0, 2.0
, Vec3: 1.0, 0.0, 2.0
, Vec3: 1.0, 0.0, 6.0
, Vec3: 11.0, 0.0, 6.0
]]
BUT if I have the following contours :
[[Vec3: 11.0, 0.0, 0.0
, Vec3: 0.0, 0.0, 0.0
, Vec3: 0.0, 0.0, 2.0
, Vec3: 11.0, 0.0, 1.9999999999999991
], [Vec3: 11.0, 0.0, 6.0
, Vec3: 11.0, 0.0, 1.9999999999999991
, Vec3: 1.0, 0.0, 1.999
, Vec3: 1.0000000149011612, 0.0, 6.000000149011612
]]
I will have this WRONG result :
[[Vec3: 11.0, 0.0, 1.9999999999999991
, Vec3: 11.0, 0.0, 0.0
, Vec3: 0.0, 0.0, 0.0
, Vec3: 0.0, 0.0, 2.0
, Vec3: 1.0000000149011612, 0.0, 6.000000149011612
, Vec3: 11.0, 0.0, 6.0
]]
I do not understand why opengl doesn’t give me the correct contour. It seems that problems occur when I have values such as 1.9999999999999991 or 6.000000149011612 and everything is ok when values are 2.0 and 6.0.
Does OpenGL prefer int numbers to double? I don’t think so, but really don’t understand how Opengl can give me a so wrong result.
If you have an idea on this problem, or if you know what is wrong, I would appreciate. Or perhaps there are some known problems with tesselation with Jogl? Or perhaps some bugs?
Thank you.