Tuesday, March 20, 2007

Platinum Wedding Centerpieces

Previous


/ * Four humanoids, Christian Duran Jorge Lara, practice No. 3, Scene 4 humanoid * /
# include / / glut library tool
# include
/ / parameters int torso
rot_torso_x = 0;
rot_torso_y int = 0;
rot_torso_z int = 0;

/ / parameters int head
rot_cabeza_x = 0;
int rot_cabeza_y = 0; rot_cabeza_z
int = 0;
/ / parameters right arm
rot_brazoder_x int = 0; rot_brazoder_y

int = 0; rot_brazoder_z
int = 0;
/ / parameters left arm
rot_brazoizq_x int = 0; rot_brazoizq_y
int = 0;
rot_brazoizq_z int = 0;
/ / parameters right leg
rot_piernader_x int = 0;
rot_piernader_y

int = 0;
rot_piernader_z int = 0;

/ / parameters left leg
rot_piernaizq_x int = 0; rot_piernaizq_y
int = 0; rot_piernaizq_z
int = 0; hum_rot_x
int [4] = {0, 15, 0, 0}; hum_rot_y
int [4 ] = {-45, 0, 20, 0}; hum_rot_z
int [4] = {0, 0, 0, 45}; hum_tras_x
int [4] = { 5, 1, -2, -3}; hum_tras_y
int [4] = {0, 1, -1, 1}; hum_tras_z
int [4] = {2, 1, -3, 2} ; hum_scal_x
float [4] = {0.5, 0.5, 1.0, 2.0}; hum_scal_y hum_scal_z float [4] = { 0.5, 0.8, 1.0, 1.0};

void init (void) / / to clean the buffers
{
glClearColor (0.0, 0.0, 0.0, 0.0);
glShadeModel (GL_FLAT)
} void

humanoid (int hum_rot_x, hum_rot_y int, int hum_rot_z, hum_tras_x int, int hum_tras_y, hum_tras_z int, float hum_scal_x, hum_scal_y float, float hum_scal_z) {



glPushMatrix ();// keeps a matrix
stack glTranslatef (hum_tras_x, hum_tras_y, hum_tras_z) / / used for translation

glScalef (hum_scal_x, hum_scal_y, hum_scal_z) / / used to climb
glRotatef (hum_rot_x, 1.0,0.0,0.0);
glRotatef (hum_rot_y, 0.0,1.0,0.0) glRotatef
(hum_rot_z, 0.0,0.0,1.0);

/ * Build the torso of the humanoid * / glPushMatrix ();//
parent keeps a stack
glTranslatef (0.0,2.0,0.0) / / used for translation
glScalef (1.7 , 4.0, 1.0), / / \u200b\u200bused to climb

glRotatef (rot_torso_x, 1.0,0.0,0.0) glRotatef
(rot_torso_y, 0.0,1.0,0.0) glRotatef
(rot_torso_z, 0.0,0.0, 1.0);
glutWireCube (1.0);
/ * built the head * /
glPushMatrix ();
glScalef (0.5,0.333,1.0)
glTranslatef (0.0,2.0,0.0) glRotatef
(rot_cabeza_x, 1.0,0.0,0.0) glRotatef

(rot_cabeza_y, 0.0,1.0,0.0);
glRotatef (rot_cabeza_z, 0.0,0.0,1.0);
glutWireCube (1.0);
glPopMatrix ();
/ * Build the right arm * /
glPushMatrix ();
glScalef (1.0,0.1666,1.0)
glTranslatef (1.0,2.0,0.0);
glRotatef (rot_brazoder_x, 1.0,0.0,0.0) glRotatef

(rot_brazoder_y, 0.0,1.0,0.0) glRotatef
(rot_brazoder_z, 0.0,0.0,1.0);
glutWireCube (1.0);
/ * Build the right forearm * /
glPushMatrix ();
glScalef (1.0,1.3,1.3);
glTranslatef (1.0,0.0,0.0);
glutWireCube (1.0);
/ * built the right * /
glPushMatrix ();
glScalef (0.25,0.5,1.0)
glTranslatef (2.5,0.0,0.0);
glutWireCube (1.0);
glPopMatrix ();
glPopMatrix (); glPopMatrix
();/* up here is the full right arm * /

/ * Build the left arm * /
glPushMatrix ();
glScalef (1.0,0.1666,1.0)
glTranslatef (-1.0,2.0,0.0)
glRotatef (rot_brazoizq_x, 1.0,0.0,0.0) glRotatef
(rot_brazoizq_y, 0.0,1.0,0.0) glRotatef
(rot_brazoizq_z, 0.0,0.0,1.0);
glutWireCube (1.0);
/ * * Build the left forearm /
glPushMatrix ();
glScalef (1.0,1.3,1.3);
glTranslatef (-1.0,0.0,0.0)
glutWireCube (1.0);
/ * left hand constructed * /
glPushMatrix ();
glScalef (0.25,0.5,1.0)
glTranslatef (-2.5,0.0,0.0)
glutWireCube (1.0);
glPopMatrix ();
glPopMatrix ();
glPopMatrix ();// up here the whole left arm
/ * Build the right thigh * /
glPushMatrix ();
glScalef (0.3333,0.6,1.0)
glTranslatef (1.0, - 1.33,0.0);
glRotatef (rot_piernader_x, 1.0,0.0,0.0);
glRotatef (rot_piernader_y, 0.0,1.0,0.0) glRotatef
(rot_piernader_z, 0.0,0.0,1.0);
glutWireCube (1.0);
/ * right calf constructed * /
glPushMatrix ();
glScalef (1.5,1.0,1.0);
glTranslatef (0.0, -1.0,0.0);
glutWireCube (1.0);
/ * RF * / glPushMatrix
();
glScalef (1.5,0.25,1.0)
glTranslatef (0.1555, -2.5,0.0);
glutWireCube (1.0);
glPopMatrix ();
glPopMatrix ();
glPopMatrix ();// up here the whole right leg
/ * Build the left thigh * /
glPushMatrix ();
glScalef (0.3333,0.6,1.0)
glTranslatef (-1.0, -1.33,0.0)
glRotatef (rot_piernaizq_x , 1.0,0.0,0.0) glRotatef
(rot_piernaizq_y, 0.0,1.0,0.0);
glRotatef (rot_piernaizq_z, 0.0,0.0,1.0);
glutWireCube (1.0);
/ * left calf constructed * /
glPushMatrix ();
glScalef (1.5,1.0,1.0 )
glTranslatef (0.0, -1.0,0.0);
glutWireCube (1.0);
/ * Build the left foot * /
glPushMatrix ();
glScalef (1.5,0.25, 1.0);
glTranslatef (-0.1555, -2.5,0.0);
glutWireCube (1.0);
glPopMatrix ();
glPopMatrix ();
glPopMatrix ();/* left leg completes * /
glPopMatrix ();/* full torso * / glPopMatrix
();/* full torso * /


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


/ / serves as an intermediate function for the construction of the scene with four humanoid scene
void (void) {

glClear (GL_COLOR_BUFFER_BIT); / / initialize color buffers
glColor3f (0.0, 1.0, 0.0), / / \u200b\u200bchoose color and solid lines cleaning
matrix glLoadIdentity ();//
gluLookAt (0.0, 0.0, 15.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0), / / \u200b\u200bhandling of the camera
humanoid (hum_rot_x [0], hum_rot_y [0], hum_rot_z [0], hum_tras_x [0], hum_tras_y [0], hum_tras_z [ 0], hum_scal_x [0], hum_scal_y [0], hum_scal_z [0]);
humanoid (hum_rot_x [1], hum_rot_y [1], hum_rot_z [1], hum_tras_x [1], hum_tras_y [1], hum_tras_z [1], hum_scal_x [1], hum_scal_y [1], hum_scal_z [1]);
humanoid (hum_rot_x [2], hum_rot_y [2], hum_rot_z [2], hum_tras_x [2], hum_tras_y [2] hum_tras_z [2], hum_scal_x [2], hum_scal_y [2], hum_scal_z [2]);
humanoid (hum_rot_x [3], hum_rot_y [3], hum_rot_z [3], hum_tras_x [3], hum_tras_y [3] , hum_tras_z [3], hum_scal_x [3], hum_scal_y [3], hum_scal_z [3]);
glFlush ();

} int main (int argc, char ** argv) {

int foo;
glutInit (& argc, argv);
glutInitDisplayMode ( GLUT_SINGLE
return 0;}

0 comments:

Post a Comment