Care to help a little more?
I drew the body in the display function.
However, I want to be able to switch between the solidsphere to wiresphere with a keystroke.
I can see that it draws the wirespheres, but only momentarily. When I let go of the key, it switches back to the solidsphere.
How do I clear the solidsphere and change to wiresphere?
I’ve included the top of my display function.
void display(void)
{
GLfloat light_position2[]= {0,.2,0,1}; // setting the flashlight position
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
gluLookAt(eyex, eyey, eyez, lookx, looky, lookz, eyex, 200.0, eyez);//sets camera location and trajectory
glutPostRedisplay();
glColorMaterial ( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ) ;//sets the room to ambient and diffuse
glLightfv(GL_LIGHT1, GL_POSITION, light_position2);//makes flashlight move with viewport
glColor3f(0,0,1);
glutSolidSphere(1, 100,100);//the torso
glPushMatrix();
glColor3f(0,1,0);
glTranslatef(0,1.4,0);
glutSolidSphere(.6,100,100);//the head