Thursday, April 5, 2007

Cocoa Butter Acne Serum

Report Task 4 Task 3 Practice 5

/ * Previous 4. Construction of a hand with 19 degrees of freedom * /
# include # include
void init (void) {

glClearColor (0.0, 0.0, 0.0, 0.0) ;

glShadeModel (GL_FLAT);}

hand void (void) {

glClear (GL_COLOR_BUFFER_BIT); glColor3f (0.0, 1.0, 0.0);

glLoadIdentity

(); gluLookAt (0.0,0.0,5.0,0.0, 0.0, 0.0, 0.0, 1.0, 0.0);

GlPushMatrix ();//

complete hand

/ / build the wrist

glTranslatef (0.0,0.5,0.0) glRotatef

(30,1.0,0.0,0.0)

glRotatef ( -10,0.0,1.0,0.0)

glRotatef (0,0.0,0.0,1.0)

glPushMatrix ();

/ / build the palm glScalef (1.0,1.0, 0.33333);

glutWireCube (1.0);


glPopMatrix ();

/ / building pinky

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);
/ / building the second phalanx

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;}

0 comments:

Post a Comment