void DrawCube(void)
{
static GLfloat wAngleX = 0.0f;
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(0.0f, 0.0f, 0.0f);
glRotatef(wAngleX, 0.0f, 1.0f, 0.0f);
wAngleX += 0.1f;
glBegin(GL_QUAD_STRIP);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, 0.5f, 0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, -0.5f, 0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, 0.5f, 0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, -0.5f, 0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, 0.5f, -0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, -0.5f, -0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, 0.5f, -0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, -0.5f, -0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, 0.5f, 0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, -0.5f, 0.5f);
glEnd();
glBegin(GL_QUADS);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, 0.5f, 0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, 0.5f, 0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, 0.5f, -0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, 0.5f, -0.5f);
glEnd();
glBegin(GL_QUADS);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, -0.5f, 0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, -0.5f, 0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(0.5f, -0.5f, -0.5f);
glColor3f(1.0f, 0.0f, 0.0f);
glVertex3f(-0.5f, -0.5f, -0.5f);
glEnd();
glPopMatrix();
glFinish();
glutSwapBuffers();
}
The above is part of my program to draw a red rotating cube.
Now, i am only able to see a solid red cube without its outline…
how can i edit the code to display the outline of the cube??
Pls help!!