### CS475 Assignment: SmallE, Part 2

\$ make
\$ ./simple

#### Implementation Details

1. Modelled a Room with Table and Chair
• Room modelled using six quads
• Hierarchical modelling for table and chair (top, legs, back etc.)
2. Textured SmallE, Room and furniture
• Textured floor, ceiling, walls, table and chair
• Textured SmallE's torso, wheels, arms and eyes
3. Two directional lights
4. Cameras
• Added options for changing camera position
• One camera follows smalle, done by updating the lookat vector in display() based on smalle's current position
• Two cameras centered on the table and chair respectively
• One camera from smalle's point of view. Camera placed at smalle's nose, looking in forward direction. Instead of calling gluLookat, implemented the transformations done by gluLookat internally to get camera co-ordinates: inverting the modelview matrix at the point of drawing the nose. Since modelview matrix is composed of only rotation and translation matrices, faster to do inversion by calculating reverse ordered product of inverses of each matrix, rather than explicitly calculating inverse of modelview matrix.
I.e. using (A1*A2*A3.....*An)^-1 == ((An^-1)*......(A3^-1)*(A2^-1)*(A1^-1))

#### Keyboard Mapping

(use capitals (shift+key) to rotate in opposite direction)

• z: rotate smalle about z axis
• x: rotate smalle about x axis
• c: rotate smalle about y axis
• q,w,e: lower neck x,y,z rotations
• a,s,d: upper neck x,y,z rotations
• t,y: rotate right arm
• u,i: rotate left arm
• f,g,h: rotate right wrist
• j,k,l: rotate left wrist
• v,b: rotate upper fingers of right wrist
• n,m: rotate upper fingers of left wrist
• o: rotate right wheel
• p: rotate left wheel
• 5,6,7: rotate head about x,y,z axis (use shift+number for opposite direction)
• UP_ARROW_KEY: translate smalle forward
• DOWN_ARROW_KEY: translate smalle backward
• LEFT_ARROW_KEY: rotate smalle left about vertical axis
• RIGHT_ARROW_KEY: rotate smalle right about vertical axis
• r: reset all degrees of freedom to default orientation