[SOLVED] EE4730 Homework 2-Improve the OpenGL GUI

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Programming-2-d0tk8h.zip (179.3 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (1 vote)

Improve the OpenGL GUI developed in HW 1. Using MeshLib (half-edge data structure) to do some basic geometric computation on triangle meshes.

  1. 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.
  2. 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 𝑣.

  1. Implement a β€œRenderEdge()” function, so that when you press β€œe”, you can see the edge connectivity shown in blue together with the mesh.
  2. 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.

  1. Compute the Gaussian curvature πœ…πΊ on each vertex. Colorize the surface:
    1. 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)
    2. 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)
    3. color all the other vertices to be gray (π‘Ÿ = 0.7, 𝑔 = 0.7, 𝑏 = 0.7).
    4. 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.

  • Programming-2-d0tk8h.zip