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 3 of 3

Thread: color of polygon and his outline

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2002
    Location
    Lyon,FRANCE
    Posts
    2

    color of polygon and his outline

    I want to draw a polygon which is red (for example) with outline black.

    other problem :
    the last object I draw is in foreground and the 3D isn't respected.
    I draw a repere(for viewing physic experience) and a graphic(polygons) with two display list.

    [This message has been edited by pato (edited 04-09-2002).]

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,982

    Re: color of polygon and his outline

    Since your post didn't include a question, I will assume you meant to ask how to do it.

    You have to draw your objects in two passes. One for the filled area, and one for the outlines. Have a look in the OpenGL FAQ for information on polygon offset, which is good if you want to avoid Z-fighting in the second pass. There are some usefull code there too.

  3. #3
    Member Regular Contributor
    Join Date
    Jan 2002
    Location
    Kingston, Jamaica, W.I.
    Posts
    282

    Re: color of polygon and his outline

    Originally posted by pato:
    I want to draw a polygon which is red (for example) with outline black.
    Draw the polygon first, then repeat the drawing using glBegin(GL_LINE_STRIP) to draw the border.

    Originally posted by pato:
    other problem :
    the last object I draw is in foreground and the 3D isn't respected.
    Could be z fighting. Or it may be that you have not enabling depth buffering. In the latter case the last item is always drawn over the item before it.

Posting Permissions

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