Report Task 4 Task 3 Practice 5
/ * Previous 4. Construction of a hand with 19 degrees of freedom * /
Thursday, April 5, 2007
Cocoa Butter Acne Serum
glShadeModel (GL_FLAT);}
hand void (void) {
glClear (GL_COLOR_BUFFER_BIT);
();
glPushMatrix ();
/ / build the palmglutWireCube (1.0);
glPopMatrix ();
/ / building pinky
glPushMatrix ();
/ / build the first joint
glTranslatef (-1.5,2.75,0.0)
glRotatef (0,1.0,0.0,0.0)
glPushMatrix ();
glScalef (1.0,1.5,1.0);
glutWireCube (1.0);
glTranslatef (0.0,1.25,0.0)
glRotatef (0,1.0,0.0,0.0)
glPushMatrix ();
glScalef (1.0,1.0,1.0);
glutWireCube (1.0);
glPopMatrix ();
/ / build the coffin bone
glTranslatef (0.0,1.0,0.0) glRotatef
(0,1.0,0.0,0.0)
glPushMatrix ();
glScalef (1.0,1.0,1.0);
glutWireCube (1.0);
glPopMatrix ();
glPopMatrix ();// end
pinky / / build the ring finger
glPushMatrix ();
/ / building the first phalanx
glScalef (0.25,0.25,0.33333)
glTranslatef (-0.5,2.75,0.0) glRotatef (0,1.0,0.0, 0.0);
glPushMatrix ();
glScalef (1.0,1.5,1.0);
glutWireCube (1.0);
glPopMatrix ();
/ Construyendo the second phalanx
glTranslatef (0.0,0.75, 0.0);
glRotatef (0,1.0,0.0,0.0);
glTranslatef (0.0,0.75,0.0);
glPushMatrix ();
glScalef (1.0,1.5,1.0); glutWireCube (1.0);
glPopMatrix ();
/ / build the coffin bone
glScalef (1.0,0.6666,1.0)
glTranslatef (0.0,1.65,0.0)
glRotatef (0,1.0,0.0 , 0.0), / / \u200b\u200bbroken only
x
glPushMatrix (); glScalef (1.0,1.0,1.0);
glutWireCube (1.0);
glPopMatrix ();
glPopMatrix final ();// finger
/ / Build the middle finger
glPushMatrix ();
/ / built the first phalanx
glScalef (0.25,0.25,0.33333) glTranslatef (0.5,2.75,0.0)
glRotatef (0,1.0,0.0,0.0)
glPushMatrix ();
glScalef (1.0,1.5,1.0);
glutWireCube (1.0);
glPopMatrix ();
/ / building the second phalanx
glTranslatef (0.0,1.75,0.0)
glRotatef (0,1.0,0.0,0.0)
glPushMatrix (); glScalef (1.0,2.0,1.0);
glutWireCube (1.0);
glPopMatrix ();
/ / build the coffin bone
glScalef (1.0,0.666,1.0)
glTranslatef (0.0,2.0,0.0);
glRotatef (0,1.0,0.0,0.0)
glPushMatrix ();
glScalef (1.0,1.0,1.0);
glutWireCube (1.0);
glPopMatrix ();
glPopMatrix ();// end of middle finger
/ / build the index finger
glPushMatrix ();
/ / build the first joint
glScalef (0.25,0.25,0.33333) glTranslatef (1.5,2.75,0.0)
glRotatef (0,1.0,0.0,0.0)
glPushMatrix ();
glScalef (1.0,1.5,1.0);
glutWireCube (1.0);
glPopMatrix ();
/ / build the second phalanx
glTranslatef (0.0,1.5,0.0) glRotatef
(0,1.0,0.0,0.0) / / broken only x
glPushMatrix ();
glScalef (1.0,1.5,1.0);
glutWireCube (1.0);
glPopMatrix ();
/ / build the third falangeh
glScalef (1.0,0.6666,1.0)
glTranslatef (0.0,1.65,0.0) glRotatef
(0,1.0,0.0,0.0) / / broken only x
glPushMatrix ();
glScalef (1.0,1.0,1.0);
glutWireCube (1.0);
glPopMatrix () ;
glPopMatrix ();// final index finger
/ / build the thumb
glPushMatrix ();
/ / build the first joint
glScalef (0.25,0.25,0.33333) glTranslatef (2.5, -1.24,0.0)
glRotatef (-30,0.0,1.0,0.0) / / broken
glRotatef (0,0.0,0.0,1.0) / / z
broken
glPushMatrix ();
glScalef (1.0,1.5,1.0);
glutWireCube (1.0);
glPopMatrix ();
/ / build the second phalanx
glTranslatef (1.0,0.0,0.0) glRotatef
(-20,0.0,1.0,0.0); / / broken only and
glPushMatrix ();
glScalef (1.0,1.5,1.0);
glutWireCube (1.0);
glPopMatrix ();
/ / build the third phalanx
glScalef (1.0,1.5,1.0);
glTranslatef (1.0,0.0,0.0) glRotatef
(-20,0.0,1.0,0.0) / / broken only and
glPushMatrix ();
glScalef (1.0,1.0,1.0);
glutWireCube (1.0);
glPopMatrix ();
glPopMatrix ();// end thumb
glPopMatrix (); / final full hand
glFlush ();
}
void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0);
glMatrixMode (GL_MODELVIEW);
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE
glutInitWindowSize (800, 800);
glutInitWindowPosition (90, 90);
glutCreateWindow (argv [0]);
init ();
glutDisplayFunc (hand); glutReshapeFunc (reshape);
glutMainLoop ();
return 0;}
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment