Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: Superposition of a triangles and its edges...

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2003
    Location
    France
    Posts
    9

    Superposition of a triangles and its edges...

    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

  2. #2
    Email address no longer exists Frequent Contributor
    Join Date
    Dec 2002
    Location
    Espoo, Finland
    Posts
    599

    Re: Superposition of a triangles and its edges...

    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

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2003
    Location
    France
    Posts
    9

    Re: Superposition of a triangles and its edges...

    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

  4. #4
    Email address no longer exists Frequent Contributor
    Join Date
    Dec 2002
    Location
    Espoo, Finland
    Posts
    599

    Re: Superposition of a triangles and its edges...

    No, it only affects the fragment depths. It'll be safe with picking.

    -Ilkka

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2003
    Location
    France
    Posts
    9

    Re: Superposition of a triangles and its edges...

    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

  6. #6
    Email address no longer exists Frequent Contributor
    Join Date
    Dec 2002
    Location
    Espoo, Finland
    Posts
    599

    Re: Superposition of a triangles and its edges...

    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

  7. #7
    Junior Member Newbie
    Join Date
    Feb 2003
    Location
    France
    Posts
    9

    Re: Superposition of a triangles and its edges...

    Thank's JustHanging
    The result was perfect...

    Keziah

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •