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