CS40: Assignment #5: Hierarchical Modeling System Paul Azunre, David Wright |
||
Lab 1 | Lab 2 | Lab 3 | Lab 4 | Lab 5 | Lab 6 | Lab 7 | Lab 8 | Lab 9
Course Page | Paul's Portfolio | David's Portfolio |
||
Description In this lab, a 2D hierarchical modeling system was developed to enable us to create and draw modules. Next, a model of Clarus the Dogcow was developed. The hierarchical modeling system was then used to animate a scene that involved three independently acting formations of three Dogcows each. The Hierarchical Modeling System The system was tested by running test code provided by Prof. Bruce Maxwell. The resulting image can be seen in Figure 1 below. Figure 1. First required image: two space fighters doing what they do best (i.e.fighting in space). The Dogcow Model The model was created by loading an image of a Dogcow into an image editing application and reading off the coordinates of several points along its body. These coordinates were then used to set points for polygons that, when combined in a DogCow module with the appropriate colors, bore some resemblance to the original image of Clarus. The resulting model is shown in Figure 2 below. Figure 2. Our Dogcow model. Moof! The Animated Dogcow Scene The Dogcow model was used to create a scene which involved three formations of Dogcows acting independently. This task was made easy by the functioning hierarchical modeling system. After the Dogcow model was created as a module, it was used as the foundation for formations of multiple Dogcows. Three formation modules were created with three Dogcow submodules each. Two of the formation modules were nearly identical, consistng of three Dogcows in a triangular formation. Both formations actually use the same underlying triangular formation submodule and merely apply different scaling and translations. The formation submodule, in turn, consists of three Dogcow submodules, each with a translation applied to specify its location in the formation. The ability to repeatedly use the same module, but apply different transformations to create more complex scenes, is the power of the hierarchical modeling system. The final formation adds a new layer in the hierarchy by putting the Dogcow modules in another module with a rotation before adding three of these rotated "Dancing Dogcow" submodules to the formation which has its own set of translations. The three formations were then added to the scene module to complete the scene. The resulting hierarchy can be seen graphically in Figure 3. Some translations were made dependent on a parameter which could be changed with a loop, allowing for the generation of a sequence of images suitable for use in an animation. Figure 3. Hierarchy of the Dogcow scene (click on the image for a larger version). To produce an animation, each formation was scaled, translated and/or rotated independently to produce desired motion effects. The first formation was made to run from left to right across the top of the view window, the second was made to run from right to left across the bottom, while the third was made to do backflips in the center. The resulting animation is shown in Figure 4 below.
Questions
Figure 5. Clarus chases a ball into a pool to demonstrate the addition of circle and ellipse primitive support.
![]()
![]() ![]() API Additions
|
||
© Paul Azunre and David Wright, 2006 |