Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jan 2005

    Draw two faces of a Polygon in OpenGL ES!!


    i have just found out that glPolygonMode() function is not implemented in OGLES?!!! How can i draw the two faces of a polygon without this function?


  2. #2
    Regular Contributor
    Join Date
    Apr 2007
    Germany, Stuttgart

    Re: Draw two faces of a Polygon in OpenGL ES!!

    I'm not sure if I got your question right. glPolygonMode is to select a mode how a polygon is painted ( GL_POINT, GL_LINE, GL_FILL ), and to select on which faces this mode is used.
    Both faces will be painted, if you deactivate cull face with glDisable(GL_CULL_FACE). To select only one face to be drawn activate cull face and use glCullFace(GL_BACK) or GL_FRONT.
    The drawing mode (points, line, triangles) can be selected directly in the glDrawArrays( GL_LINES,.... ) statements.

    I hope this was helpfull...

    Best Regards,

  3. #3
    Nokia Developer Expert
    Join Date
    Mar 2003

    Re: Draw two faces of a Polygon in OpenGL ES!!


    glPolygonMode() is actually NOT part of the OpenGL ES API. As only *triangles* are supported as a way to render polygons, there is no need for this API entry point. LINEs and POINTs are supported as render primitives (but not as polygon render modes).

    If the original question was about two-sided lighting (since OpenGL ES does not support separate materials for front and back), then there is no other way than to render two-sided geometry twice (once with front material and once with back material and setting cullface/frontface accordingly).

    glCullFace() and glFrontFace() are supported normally.

    Jani Vaarala
    Graphics Architect

  4. #4
    Regular Contributor
    Join Date
    Jan 2005

    Re: Draw two faces of a Polygon in OpenGL ES!!

    Thanx for the reply.
    Actually i was confused a bit with glPolygonMode and its GL_FILL mode. I did not think about the GL_CULL_FACE state!! Now i got both faces rendered fully.


Similar Threads

  1. Replies: 0
    Last Post: 2008-04-15, 08:38
  2. Draw full screen viewfinder with OpenGL ES, but tearing
    By fishman8 in forum Symbian Media (Closed)
    Replies: 18
    Last Post: 2008-02-01, 14:38
  3. Possible OpenGL ES implementation bug
    By greatape in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2006-10-28, 18:02
  4. How to draw a polygon?
    By syngle in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-04-01, 03:03
  5. polygon draw speed
    By bobby_newmark in forum Mobile Java General
    Replies: 0
    Last Post: 2003-02-27, 12:44

Posting Permissions

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