Improve the OpenGL GUI developed in HW 1. Using MeshLib (half-edge data structure) to do some basic geometric computation on triangle meshes.
- Include meshlib files into hw1 project and make the GUI work like hw1. Now, instead of using your original OBJ reading function, you can directly use ReadOBJFile() function to read an OBJ file to the mesh object. Then, revise the Bounding box computation, and mesh rendering functions accordingly to get the mesh rendered.
- Implement the ComputeNormals() function to compute the normal vector on each vertex. The vertex normal is a weighted average of normal vectors of this vertexβs surrounding face,
where ππΉ(π£) is the set of neighboring faces surrounding the vertex π£, and the weight πΌπ is the interior corner angle of ππ at π£.
- Implement a βRenderEdge()β function, so that when you press βeβ, you can see the edge connectivity shown in blue together with the mesh.
- Trace all the boundary loops and compute the boundary loop number π.
Print π on the screen. Also implement a βRenderBoundary()β function, so that when you press βbβ, you can see the boundary loops shown in yellow on the mesh.
- Compute the Gaussian curvature π
πΊ on each vertex. Colorize the surface:
- color a vertex to green if its curvature π πΊ < β0.05 and its curvature is a local minimum (i.e., value β€ curvatures of its surrounding vertices)
- color a vertex to red if its curvature π πΊ > 0.05 and its curvature is a local maximum (i.e., value β₯ curvatures of its surrounding vertices)
- color all the other vertices to be gray (π = 0.7, π = 0.7, π = 0.7).
- Display/undisplay these color when the key βkβ is pressed.
Hint:Β to make your program efficient, you can use an array to store your computed properties. For example, in Step 2, you can first compute all the face normal vectors, and store them in a point (namely, 3D vector) array
ππ[0, β¦ , πΉ β 1]. In the mesh library, each face π has an index πβ> πππππ₯(). You can just store each face πβs normal in ππ[π β πππππ₯()]. In Step 4, similarly, you may want to use a flag array to store if a boundary edge is visited or not. In Step 5, also store computed curvatures of all the vertices.
Please write all you codes in your βhw2.cppβ file (do not modify any file from the meshlib) and send the hw2.cpp to me. I will compile it with the meshlib files on my computer.



