Hi, in my codes below, I cannot draw a rectangular polygon as i expected. What I have drawn is just seems to be a “half of a cube”
glBegin(GL_POLYGON);
// Front Face
glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad
glVertex3f( 1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad
glVertex3f( 1.0f, 0.01f, 1.0f); // Top Right Of The Texture and Quad
glVertex3f(-1.0f, 0.01f, 1.0f); // Top Left Of The Texture and Quad
// Back Face
glVertex3f(-1.0f, -1.0f, -1.0f); // Bottom Right Of The Texture and Quad
glVertex3f(-1.0f, 0.01f, -1.0f); // Top Right Of The Texture and Quad
glVertex3f( 1.0f, 0.01f, -1.0f); // Top Left Of The Texture and Quad
glVertex3f( 1.0f, -1.0f, -1.0f); // Bottom Left Of The Texture and Quad
// Top Face
glVertex3f(-1.0f, 0.01f, -1.0f); // Top Left Of The Texture and Quad
glVertex3f(-1.0f, 0.01f, 1.0f); // Bottom Left Of The Texture and Quad
glVertex3f( 1.0f, 0.01f, 1.0f); // Bottom Right Of The Texture and Quad
glVertex3f( 1.0f, 0.01f, -1.0f); // Top Right Of The Texture and Quad
// Bottom Face
glVertex3f(-1.0f, -1.0f, -1.0f); // Top Right Of The Texture and Quad
glVertex3f( 1.0f, -1.0f, -1.0f); // Top Left Of The Texture and Quad
glVertex3f( 1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad
glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad
// Right face
glVertex3f( 1.0f, -1.0f, -1.0f); // Bottom Right Of The Texture and Quad
glVertex3f( 1.0f, 0.01f, -1.0f); // Top Right Of The Texture and Quad
glVertex3f( 1.0f, 0.01f, 1.0f); // Top Left Of The Texture and Quad
glVertex3f( 1.0f, -1.0f, 1.0f); // Bottom Left Of The Texture and Quad
// Left Face
glVertex3f(-1.0f, -1.0f, -1.0f); // Bottom Left Of The Texture and Quad
glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom Right Of The Texture and Quad
glVertex3f(-1.0f, 0.01f, 1.0f); // Top Right Of The Texture and Quad
glVertex3f(-1.0f, 0.01f, -1.0f); // Top Left Of The Texture and Quad
glEnd();