Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. fill in the polygon

fill in the polygon

Scheduled Pinned Locked Moved Graphics
architecturehelpquestion
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member 3375334
    wrote on last edited by
    #1

    hello everyone i really need your help here.... i have implemented a program that is clipping the polygon against a square.. what i need to do now is to use the vertices that got created after clipping to fill in the polygon

    void OnFillPolygon()
    {
    // TODO: Add your command handler code here
    wglMakeCurrent(m_hDC,m_hRC);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    ::SwapBuffers(m_hDC);
    glPushMatrix();
    glColor3f( 1.0, 0.0, 0.0 ); //red
    glPolygonMode( GL_FRONT, GL_FILL );
    glBegin( GL_POLYGON ); //draw solid polygon
    glVertex2i( 10, 10 );
    glVertex2i( 100, 10 );
    glVertex2i( 150, 50 );
    glVertex2i( 100, 100 );
    glVertex2i( 50, 80 );
    glVertex2i( 10, 10 );*/
    glEnd();
    glPopMatrix();
    wglMakeCurrent(m_hDC,NULL);
    wglMakeCurrent(m_hDC,m_hRC);
    glFlush();
    ::SwapBuffers(m_hDC);
    }

    this is just specifying exact vertex values...
    what should i do so that those were the vertices after clipping.....?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups