CS 6610 Advanced Computer Graphics - Project 1
Zach Gildersleeve
Sept. 26, 2006
CADE login: gildersl
Graduate level credit
Program Description
This program creates an animated, walking robot in OpenGL using hierarchical transformations, and provides user interactivity through a GUI implemented in GLUI.
Source Code
The souce code, both the Xcode files and the Visual Studio files, can be found here (5.21MB .zip).
Development Platform
This project was coded in C++ in Xcode on OS X (10.4.7) and then was ported to MS Visual Studio 2005 on a Windows XP machine. This move was made to fulfill the assignment requirements. There are know problems with the GLUI implementation on OS X, and so all GLUI functionality was added in the Windows environment.
Project Features
Upon launch, a simple tessellated and checkered ground plane is drawn, as is an anthropomorphic robot figure, drawn using hierarchical transformations. Simple lighting is provided, allowing the user to see the ground plane, the robot, and the robot's tattoo on its chest. The tattoo is drawn as an GL_Line_Strip. The light and camera position are hard coded in the program. As the robot is built for bipedal walking, complete with knee and elbow joints, it starts walking immediately. The user can right click and drag with a mouse on each of the robot's limbs (i.e. upper and lower arms and legs) and rotate each limb around its rotation axis, constrained by the parent joint. Clicking on a limb to modify a limb rotation will stop the robot, and it must be restarted using the GUI. If the robot's limbs are posed in arbitrary positions and then the robot is restarted, the robot maintains the user selected rotation and incorporates it into its animation.
Graphical User Interface
A GUI implemented in GLUI provides additional features. In the "Move It!" section, a rotation arcball and XZ translation box are provided. The arcball is constrained to return a rotation around the Y axis, meaning that the robot cannot be tipped upside down. Currently, the robot rotates around its starting origin, rather than around its local Y axis (see Known Bugs). The XZ translation box allows the user to drag the robot's current position around the ground plane. A reset button is provided to send the robot back to its starting location, and reset all rotation and user selected limb rotation.
In the "Groove It!" section, a start / stop button is provided that can start and stop the robot's animation. A spinner is also provided in which the user may dial in the robot's walking speed, selecting from a value between 0.5 and 2.5. The default of 1.0 provides the most natural animation, and works best with the robot's limb's constrained rotation values and conditional rotation pattern.
Additionally, checkboxes are provided that allow the user to not draw the ground plane, or to render without depth testing. Finally, an exit button quits the program.
Known Bugs
- The rotation arcball rotates the robot around the world space's Y axis, rather than the ideal, the robot's local Y axis.
- The rotation arcball currently has a sticking point at 0 degrees, where rotation flips direction if the arcball spins past this point, rather than simply continuing in the current direction of rotation, and rotates freely while still returning only the Y axis rotation, rather than the arcball icon itself being constrained.
- The limb selection and rotation is not ideal, in that more accurate control of the limb rotation is provided the closer the user clicks to the limb's rotation pivot point, and conversely, non-intuitive behavior exists the farther one clicks from a joint. For example, clicking on a forearm near the elbow allows very precise control of the rotation, but clicking near the wrist can flip the joint 180 degrees before the user learns to control rotation at that point. This is not a bug per se, but is less than ideal.