next up previous
Next: finger Up: Code Previous: display

palm

void palm() // draws the palm of the hand
{
  glColor3f(1.0, 1.0, 0.0);
	
	
  glPushMatrix();
    glutSolidTorus(1.0, 2.5, 20, 20);  // the circular part of the palm
  glPopMatrix();
  glPushMatrix();
	glTranslatef(0, 0, .7);
	gluDisk(gluNewQuadric(), 0, 2.5, F, F);
  glPopMatrix();
  glPushMatrix();
	glTranslatef(0, 0, .49);
	//glRotatef(180, 1.0, 0, 0);
	//gluQuadricDrawStyle(qobj, GLU_FILL);
	//gluQuadricOrientation(qobj, GLU_INSIDE);
	//gluQuadricNormals(qobj, GLU_FLAT);  // GLU_FLAT  GLU_SMOOTH  GLU_NONE
	//gluQuadricOrientation(qobj, GLU_INSIDE);
	//gluCylinder(gluNewQuadric(), 0, 2.5, .5, F, F);
  glPopMatrix();
  glPushMatrix();
    glTranslatef(0, 0, -.9);
	gluDisk(qobj, 0, 2.5, F, F);
  glPopMatrix();
}
This function, obviously, draws the palm of the hand. The torus is the curcular rim of the hand. The two disks that come next complete the flat portions of the hand inside the torus. The first call uses a new quadric because the normals are toward the screen, or out on the near portion. The second call uses qobj because it has reversed normals. becaus rthis is the back of the hand, this results again in outward normals. The middle section of code was an attempt to smooth the line between the torus and the 2 planes. This would have been done with a shallow cone that only appears as a fller where the torus and planes meet, making a smoother transition. For a reason that I could not figure out, the normals would not reverse to the inside of the cone, something that was necessary in order for the cone to appear the right color. I tried ,many different modifir functions that the openGL book said would work, but none did. I eventually scrapped this idea and lived with a slightly less realistic model.



Michael Hull 2003-06-11