This is the final project for a Computer Graphics class I took in Spring of 2012. In groups of three, we were to make a simplified version of the 3D modelling software Autodesk Maya. Each person in the group had a specific, named role - the geometer, the visualizer, and the deformer. The Visualizer wrote the camera controls, shader functionality, and did some UI design. The Deformer was tasked with mesh deformations, file loading and writing, and a global "twist" operation. I was the group's Geometer. My responsibilities were to program the half-edge data structure that forms the 3D meshes and holds up against a variety of mesh modifications like subdividing faces or adding extra vertices. I also was tasked with implementing Catmull-Clark subdivision, which is a smoothing operation that uses existing geometry to compute a new, higher density mesh. The goal of the feature was to, with repeated clicks of the smooth button, turn a cube into a sphere.
Here is the app in all of its glory. The interface was done in Qt (which I've since learned a lot about, this could be much prettier with a little CSS), and the code itself was all C++ and OpenGL. This is the default setup, with a multicolored cube at the disposal of an array of modification buttons.
Above are some images of the Catmull-Clark algorithm in action (the purple square marks the currently selected vertex). The gist of it is that it puts a new vertex at the center of every face, then shifts the original vertices to positions that are averaged from the adjacent face centers. Between the first two images in that group you can see that the closest cyan face gets split into four, smaller faces, which each get split into four again, and so on. This implementation will also smooth triangles and any other weird shape. The swiss cheese effect at the end is just a result of too much smoothing. The faces become too small to display properly. If you look closely at the top side, you can see a regular diagonal pattern.
The Catmull-Clark algorithm is pretty simple, but the implementation was a little harder. Debugging consisted of a lot of diagrams of half-edge meshes and meticulous paper cutouts of cubes.
Writing the half-edge data structure that defines the mesh, and all the accompanying edge-juggling functions, were also among my responsibilities. This was a semester-long project that required building successively more complicated pieces of software from our own unique codebases we wrote from scratch. It was this codebase I'd been maintaining for several months that was the foundation for this final project. It was an interesting process, building up such a huge library of code over the course of a semester, and it was cool seeing how different the final programs were. Just before the submission deadline, each group did a short demo for the class to show off their progress, and any other features they'd come up with. Our showstopper was party mode.