hierarchical modeling
play

Hierarchical Modeling CS418 Computer Graphics John C. Hart Build a - PowerPoint PPT Presentation

Hierarchical Modeling CS418 Computer Graphics John C. Hart Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix();


  1. Hierarchical Modeling CS418 Computer Graphics John C. Hart

  2. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  3. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  4. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0);   1 glScalef(0.25,1.0,0.25);   2   glutSolidCube(2.0);     glPopMatrix(); 1     1

  5. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  6. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1);   1 glTranslatef(0,-1,0);   4 glScalef(0.25,1.0,0.25);   1 glutSolidCube(2.0);   glPopMatrix(); 1   4     1

  7. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1);   1 glTranslatef(0,-1,0);    1  4 glScalef(0.25,1.0,0.25);      1 1 1    glutSolidCube(2.0);     glPopMatrix(); 1 1     4     1  1

  8. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1);   1  glTranslatef(0,-1,0);      c s 1  4 glScalef(0.25,1.0,0.25);        s c 1 1 1      glutSolidCube(2.0);       glPopMatrix(); 1 1 1       4       1 1  1

  9. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1);   1    glTranslatef(0,-1,0); 1      1 1 c s 1  4    4 glScalef(0.25,1.0,0.25);       s c 1 1 1    1 2     glutSolidCube(2.0);         glPopMatrix(); 1 1 1 1         4        1 1   1   1

  10. Build a Robot push/pop glPushMatrix(); matrix glPushMatrix(); keeps body glScalef(1.0,2.0,1.0); scale from glutSolidCube(2.0); affecting glPopMatrix(); shoulder glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  11. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  12. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  13. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  14. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  15. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  16. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); push/pop glTranslatef(0,-1,0.0); allows the glScalef(0.25,1.0,0.25); forearm to glutSolidCube(2.0); ignore these glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  17. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  18. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  19. Build a Robot glPushMatrix(); glPushMatrix(); glScalef(1.0,2.0,1.0); glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix(); glTranslatef(0,-2,0); glRotatef(elbow,0,0,1); glTranslatef(0,-1,0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); glPopMatrix();

  20. Build a Robot Modelview:   1   1   glPushMatrix();   1 glPushMatrix();     glScalef(1.0,2.0,1.0); 1 glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); Stack: glPopMatrix();   glTranslatef(0,-2,0); 1   glRotatef(elbow,0,0,1); 1   glTranslatef(0,-1,0);   glScalef(0.25,1.0,0.25); 1   glutSolidCube(2.0);   1 glPopMatrix();

  21. Build a Robot Modelview:   1   1   glPushMatrix();   1 glPushMatrix();     glScalef(1.0,2.0,1.0); 1 glutSolidCube(2.0); glPopMatrix(); glTranslatef(1.25,2,0.0); glRotatef(shoulder,0,0,1); glPushMatrix(); glTranslatef(0,-1,0.0); glScalef(0.25,1.0,0.25); glutSolidCube(2.0); Stack: glPopMatrix();     glTranslatef(0,-2,0); 1 1     glRotatef(elbow,0,0,1); 1 1     glTranslatef(0,-1,0); ,     glScalef(0.25,1.0,0.25); 1 1     glutSolidCube(2.0);     1 1 glPopMatrix();

Recommend


More recommend