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

Thread: two sided polygons

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2005
    Posts
    1

    two sided polygons

    im fairly new to opengl and whenever i put a polygon either w/ a texture or w/ a color, i must specify the vertecies in a clockwise order, and if i rotate around the polygon, the otherside is black... is there a function that can enable opengl to display the texture on both sides of the polygon?

  2. #2
    Intern Newbie
    Join Date
    Mar 2003
    Location
    SPAIN
    Posts
    42

    Re: two sided polygons

    Hi, you can use glDisable( GL_CULL_FACE ) or glEnable( GL_CULL_FACE ) to see or not the hidden face. You can use glCullFace(GL_FRONT_AND_BACK) too for choosing the desired mode.

  3. #3
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: two sided polygons

    If you see the backside face culling is obviously off (default) and that it's black is probably because lighting is enabled and the texture is modulated (default) with the light.
    The normals point away from front side and the backside is not lit unless your normals are screwed (huh?), or you enable two sided lighting (aha!), or you just set the texenv mode to GL_DECAL and get a full color non-lit texture.

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    768

    Re: two sided polygons

    Setup a new clear color and it should be easy to check if Relic got the point.
    For instance, call glClearColor(0.5,0.5,0.5,0);

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2005
    Posts
    1

    Re: two sided polygons

    ok... hmmm... ive tried glCullFace(GL_NONE);, which views the front of the polygons, but not the back... and ive tried glCullFace(GL_FRONT_AND_BACK);, which seems to remove the whole model... and ive tried glCullFace(GL_BACK);, which shows the back of the polygons, but not the front... and glCullFace(GL_FRONT); which appears to do the same as glCullFace(GL_BACK);, i have changed the clear color to .5,.5,.5,0 like mentioned also, and instead of the backs of the polygons black, they turned the clear color... theres no happy medium? or maybe its just that the light isn't hitting the back of the polygons? if thats the case, should i put a floor or something down?

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    768

    Re: two sided polygons

    If you can see that the back of your face is black (visible, but black) then you either have to setup a second light, known as back-light, or to enable two-sided lighting using glLightModel

Posting Permissions

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