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

Thread: Draw polygon

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2008
    Posts
    6

    Draw polygon

    i used this code to draw rectangle but i dunno how modify it to draw a six vertice polygon. please help ...

    glTranslatef(3.0f,0.0f,0.0f); // Move Right 3 Units
    glBegin(GL_POLYGON); // Draw A Quad
    glVertex3f(-1.0f, 1.0f, 0.0f); // Top Left
    glVertex3f( 1.0f, 1.0f, 0.0f); // Top Right
    glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
    glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
    glEnd();

  2. #2
    Intern Contributor
    Join Date
    Jul 2004
    Location
    Toronto
    Posts
    97

    Re: Draw polygon

    Add 2 more glVertex3f calls to your code.

Posting Permissions

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