CS 480: Computer Graphics

Graphics Projects

Project 1: Midpoint Algorithm
The first assignment was implemented in Processing. The task was to implement the Midpoint Algorithm to rasterize lines pixel-by-pixel without using the built-in function to draw a line between 2 points clicked on the pad. I added the extra functionality of being able to "pick up the pen" to start a new set of lines; of rotating colors per line; of point coordinates being displayed.

Project 2: Matrix Transformations
The second project was also implemented in Processing. The task was to take scene files (.sff), parse in the data, and render the image meshes. The files contained information for color, rotation, scaling, translation, and verticies for each polygon. The process was: rotate about x axis, rotate about y axis, rotate about z axis, scale, translate, convert from world coordinates to camera coordinates, convert from camera coordinates to NDC, convert X and Y to windows coordinates, and finally to draw the lines.





Project 3: OpenGL Calls & 3D Graphics
The third project was a group project. My team of 5 chose to design and implement an interactive 3D Lego Builder World using JOGL (Java OpenGL). The user can select which block shape (we only implemented 2x2 blocks, but there is room to expand to other block shapes, like 4x2 blocks, cylinders, etc.) and which block color (red, yellow, blue, black, white), then use the arrow buttons to move the block around in the world before placing it with "Add Block". The current block being edited is transparently displayed ("alpha"). When a block is placed, the alpha block becomes solid and a new one appears on top of it. When a block is removed, the alpha block is removed and the last solid/added block becomes the new alpha/current block. The Q, W, E, A, S, and D keys manipulate the camera of the scene (when the viewer is "in focus"). There is also a side applet, external to the GUI, that displays a 3D spinning demo of the block with textures; this was implemented in Java3D. The origin of the applet is this: we modeled the Legos in Maya, which were exported to .obj files and .mtl files. Java3D was the only library that contained a built-in object file loader, and after we got the modeled Legos to display, we realized this Java3D functionality was outside the scope of the OpenGL-based project, so we decided to keep the applet as a demo of what future implementations could look like. We ended up simplifying the .obj files of the Lego models so we could write our own parser to manage only vertices, vertex normals, and faces (no textures).
My contributions to the project include: the 3D spinning Java3D applet; adding JOGL lighting to the scene to give the Lego blocks a 3D look; adding functionality to the GUI to change the Lego color and position in real-time; adding functionality to the GUI to "Add", "Undo", and "Clear All" Lego blocks; managing the height of the new "alpha" blocks so they know when to stack on top of a block, or drop back to the platform; the starting framework for the Block, Point, Color, and Size object classes (members of the team, myself included, added to these files as was necessary as the project evolved).








 


Go Back Home

Last Updated: April 28, 2009
Contact: sadkins@usc.edu
 
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees