PDA

View Full Version : Superposition of a triangles and its edges...



keziah23li98
02-08-2003, 06:34 AM
Hi,
I would like to know what functions i should use for creating a full colored triangle and its edges in a different color without any problem of superposition.
Thx,

keziah

JustHanging
02-09-2003, 07:39 AM
Hi,

If I understand you correctly, some pixels of your lines don't show. That's because of z fighting, and can be fixed with glPolygonOffset.

-Ilkka

keziah23li98
02-09-2003, 10:54 PM
Thank's,
Did this method affect the real coordinates of the triangles or picking method?
I will try it and will imform you.
Thank's

keziah

JustHanging
02-09-2003, 11:01 PM
No, it only affects the fragment depths. It'll be safe with picking.

-Ilkka

keziah23li98
02-11-2003, 05:22 AM
Hi,
Certainly i don't know how to use this command but it doesn't seem to work...I think if I want you could help me, i must be more explicit...
I'm working on a optimisation meshing programm, and i want to use it esaly on windows. Is this program i use in same time triangles, its egdes(lines) and the points of the lines. My aim is actually to select this item on the screen. But in the GL scene i draw triangles, lines and points whith the same coordinates. It's look like superposition pixels. Sometime i saw traingles, or edges... I don't konw what i must do to correct this problems.
Maybe you could help me....i hope.
Thank's

keziah

JustHanging
02-11-2003, 10:03 AM
Hi,

No wonder you can't use it, the polygon offset specs are quite technical and not very helpful to learning how to actually use it. Maybe the way they should be but...

The polygon offset is used to offset the depths of rasterized polygons. It's designed for situations like yours where nearly equal depth values cause problems. As far as I know, it can only be used for filled polygons, so you offset them a little bit further so that the lines can be drawn solid. In practice:

glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1, 2);
-draw faces-
glDisable(GL_POLYGON_OFFSET_FILL);
-draw lines-

That should do it. If the lines still have holes in them, increase the polygonOffset values.

-Ilkka

keziah23li98
02-15-2003, 04:00 AM
Thank's JustHanging
The result was perfect...

Keziah