CS 315 Homework 3 - CubeBot

Due Wed Oct 08 Fri Oct 10 at 11:59pm

Overview

In this assignment, you will be modeling and rendering a small scene made up entirely of 3D cubes. Your scene will center on a posed humanoid robot--a robot that you will be animating in the next assignment!

An example of a CG robot using cubes and spheres (by Dave Akers). Yours should only use cubes, and need not be quite this detailed.

In modeling this robot, you will have a chance to practice working with 3D transformations in OpenGL--and in particular with transformation hierarchies (creating series of transformations that can be used to easily describe characters with a "connected" body) as part of a "scene graph". You will also begin working with implementing ways to manipulate the "viewing" angle, as well as include more jQuery-based interactions

This assignment should be completed individually. You should not use any 3rd party libraries (check with me if you wish to).

Objectives

Necessary Files

You will need a copy of the cs315-hwk3.zip file which contains the starter code for this assignment. The file structure is nearly identical to the last assignment; however, I've made a few notable changes:

Note that the zip file also contains a README.txt file that you will need to fill out.

Assignment Details

Note that this assignment is less specifically detailed than the last--the OpenGL stuff has been handled for you; mostly you're just working with transformations and coordinate frames at this point!

Designing CubeBot



Figures by Wayne O. Cochran

Your robot will consist of several moving components: a torso, two two-segment arms, two two-segment legs, and a head (6 components total). Each upper arm will positioned relative to the reference frame of the torso, each lower arm relative to the reference frame of the corresponding upper arm, etc.

Your robot will be built from copies of a single basic primitive (provided for you): a cube. Cubes can be scaled and stretched into rectangles, and combined to produce more complex shapes.

Rendering CubeBot

After you've designed your robot, you'll need to model and render it in WebGL. Since robots are made up of cubes, you won't be modeling it in terms of vertex positions, but instead in terms of the transformations applied to each cube to put it into the proper position. Basically each piece of the robot will be represented by a different model matrix that applies to the cube--in particular, a transformation hierarchy of model matrixes, like we discussed in class.

Posing CubeBot

Once you have your basic robot drawn, you should specify a "pose" for that robot.

Looking at CubeBot

At this point, you should have your modeled and posed robot rendering. However, it would be nice to be able to view your posed robot from different angles. For the last part of the assignment, add the ability to use the mouse of move the camera around the robot by clicking and dragging.

In the end, your program should render your posed robot, and allow the user to drag the camera around to view your robot from different angles.

Extensions

There are a number of possible extensions to this assignment--some of which you'll be implemented in the next assignment! If you finish early (and the description is online), I recommend you start on that assignment next.

As another possibility: one of the issues with trackball rotation is that moving from \( \mathit{P_0} \) to \( \mathit{P_1} \) and then from \( \mathit{P_1} \) to \( \mathit{P_2} \) doesn't give you the same rotation as moving directly from \( \mathit{P_0} \) to \( \mathit{P_2} \). As a fix for this, you might look up and implement an arcball rotation.

Additionally, achieving smooth rotations is more effective with quaternions in place of matrices. We'll go over these in more detail for the next assignment, but you might look them up and see how to integate them into your assignment!

Submitting

BEFORE YOU SUBMIT: make sure your code is fully functional! Grading will be based primarily on functionality. I cannot promise that I can easily find any errors in your code that keep it from running, so make sure it works.

Upload your entire project (including the lib/ folder) to the Hwk3 submission folder on vhedwig (see the instructions if you need help). Also include a filled-in copy of the README.txt file in your project directory!

The homework is due at midnight on Wed Oct 08 Fri Oct 10.

Grading

This assignment will be graded out of 19 points: