glPushMatrix();
    glBegin(GL_QUADS);
 
       glVertex3f(0.0f, 0.0f, 0.0f); // top face
       glVertex3f(0.0f, 0.0f, -1.0f);
       glVertex3f(-1.0f, 0.0f, -1.0f);
       glVertex3f(-1.0f, 0.0f, 0.0f);

       glVertex3f(0.0f, 0.0f, 0.0f); // front face
       glVertex3f(-1.0f, 0.0f, 0.0f);
       glVertex3f(-1.0f, -1.0f, 0.0f);
       glVertex3f(0.0f, -1.0f, 0.0f);

       glVertex3f(0.0f, 0.0f, 0.0f); // right face
       glVertex3f(0.0f, -1.0f, 0.0f);
       glVertex3f(0.0f, -1.0f, -1.0f);
       glVertex3f(0.0f, 0.0f, -1.0f);

       glVertex3f(-1.0f, 0.0f, 0.0f); // left face
       glVertex3f(-1.0f, 0.0f, -1.0f);
       glVertex3f(-1.0f, -1.0f, -1.0f);
       glVertex3f(-1.0f, -1.0f, 0.0f);

       glVertex3f(0.0f, -1.0f, 0.0f); // bottom face
       glVertex3f(0.0f, -1.0f, -1.0f);
       glVertex3f(-1.0f, -1.0f, -1.0f);
       glVertex3f(-1.0f, -1.0f, 0.0f);

       glVertex3f(0.0f, 0.0f, -1.0f); // back face
       glVertex3f(-1.0f, 0.0f, -1.0f);
       glVertex3f(-1.0f, -1.0f, -1.0f);
       glVertex3f(0.0f, -1.0f, -1.0f);

    glEnd();
 glPopMatrix();

하나의 Quad마다 각 4개의 vertex를 CCW의 순서로 정해주는것이 뽀인트 이다.

저작자 표시
Posted by 쾌걸조롱


티스토리 툴바