I'm trying to draw a square room in openGL, and I have this:
void drawWalls()
{
glColor3f(1,0,0);
glPushMatrix();
//glRotatef(0,0,0,1);
//glScalef(2,1,2);
glBegin(GL_QUADS);
/* Floor */
glVertex3f(-1,-1,-1);
glVertex3f(1,-1,-1);
glVertex3f(1,-1,1);
glVertex3f(-1,-1,1);
/* Ceiling */
glVertex3f(-1,1,-1);
glVertex3f(1,1,-1);
glVertex3f(1,1,1);
glVertex3f(-1,1,1);
/* Walls */
glVertex3f(-1,-1,1);
glVertex3f(1,-1,1);
glVertex3f(1,1,1);
glVertex3f(-1,1,1);
glVertex3f(-1,-1,-1);
glVertex3f(1,-1,-1);
glVertex3f(1,1,-1);
glVertex3f(-1,1,-1);
glVertex3f(1,1,1);
glVertex3f(1,-1,1);
glVertex3f(1,-1,-1);
glVertex3f(1,1,-1);
glVertex3f(-1,1,1);
glVertex3f(-1,-1,1);
glVertex3f(-1,-1,-1);
glVertex3f(-1,1,-1);
glEnd();
glPopMatrix();
}
For whatever reasons, it's not drawing all of my sides! I've looked through my vector and it appears to be correct... But when you look inside, you see this:
What am I doing wrong? Or if possible, is there a better way to draw a room rather than this? Thanks