CS 184: Computer Graphics and Imaging, Spring 2024

Homework 2: Mesh Edit

Ian Dong

Overview

In this homework, I explored the world of mesh editing through building Bezier curves and surfaces using the de Casteljau algorithm and implementing various mesh operations such as area-weighted vertex normals, edge flip, edge split, and loop subdivision.

Section I: Bezier Curves and Surfaces

Part 1: Bezier Curves with 1D de Casteljau Subdivision

Briefly explain de Casteljau's algorithm and how you implemented it in order to evaluate Bezier curves.


Take a look at the provided .bzc files and create your own Bezier curve with 6 control points of your choosing. Use this Bezier curve for your screenshots below.


Show screenshots of each step / level of the evaluation from the original control points down to the final evaluated point. Press E to step through. Toggle C to show the completed Bezier curve as well.


Show a screenshot of a slightly different Bezier curve by moving the original control points around and modifying the parameter \(t\) via mouse scrolling.


Part 2: Bezier Surfaces with Separable 1D de Casteljau

Briefly explain how de Casteljau algorithm extends to Bezier surfaces and how you implemented it in order to evaluate Bezier surfaces.


Show a screenshot of bez/teapot.bez (not dae) evaluated by your implementation.




Section II: Triangle Meshes and Half-Edge Data Structure

Part 3: Area-Weighted Vertex Normals

Briefly explain how you implemented the area-weighted vertex normals.


Show screenshots of dae/teapot.dae (not .bez) comparing teapot shading with and without vertex normals. Use Q to toggle default flat shading and Phong shading.


Part 4: Edge Flip

Briefly explain how you implemented the edge flip operation and describe any interesting implementation / debugging tricks you have used.


Show screenshots of the teapot before and after some edge flips.


Write about your eventful debugging journey, if you have experienced one.



Part 5: Edge Split

Briefly explain how you implemented the edge split operation and describe any interesting implementation / debugging tricks you have used.


Show screenshots of a mesh before and after some edge splits.


Show screenshots of a mesh before and after a combination of both edge splits and edge flips.


Write about your eventful debugging journey, if you have experienced one.


Extra Credit: If you have implemented support for boundary edges, show screenshots of your implementation properly handling split operations on boundary edges.


Part 6: Loop Subdivision for Mesh Upsampling

Briefly explain how you implemented the loop subdivision and describe any interesting implementation / debugging tricks you have used.

I decided to follow the order of operations as described in the spec. Here are the formal steps I took to implement the loop subdivision:

  1. First, I iterated through all of the vertices in mesh using a for loop over the mesh.verticesBegin() and mesh.verticesEnd() iterators. For each vertex, I found all of the neighbors that were connected to it and then computed the new position by weighting it as the sum following the formula from lecture. I then set the vertex->newPosition to this weighted position and the vertex->isNew to false because this was not a newly created vertex.
  2. Next, I iterated through all of the edges in the mesh using a for loop over the mesh.EdgesBegin() and mesh.EdgesEnd() iterators. For each edge, I found the vertex and face that it was connected to and then computed the new position by weighting it as the sum following the formula from lecture. I then set the e->newPosition to this weighted position and the e->isNew to false because this was not a newly created edge.
  3. Then, I iterated through all of these edges in the original mesh again in order to split each of them and updated their position to be that of the previously computed new position stored in the edge.
  4. Afterwards, I iterated through all the edges in the mesh and flipped any of the newly created edges that connected an old and new vertex.
  5. Finally, I iterated through all of the vertices to set their position to the previously computed new position stored in the vertex.


Take some notes, as well as some screenshots, of your observations on how meshes behave after loop subdivision. What happens to sharp corners and edges? Can you reduce this effect by pre-splitting some edges?


Load dae/cube.dae. Perform several iterations of loop subdivision on the cube. Notice that the cube becomes slightly asymmetric after repeated subdivisions. Can you pre-process the cube with edge flips and splits so that the cube subdivides symmetrically? Document these effects and explain why they occur. Also explain how your pre-processing helps alleviate the effects.


If you have implemented any extra credit extensions, explain what you did and document how they work with screenshots.

I did not implement any extra credit extensions.