1. Homepage
  2. Programming
  3. COMP4610/8610 Computer Graphics - Computer Lab Assignment 3: Mesh Processing

COMP4610/8610 Computer Graphics - Computer Lab Assignment 3: Mesh Processing

Engage in a Conversation
ANUCOMP4610COMP8610Computer GraphicsMesh ProcessingC++

COMP4610/8610 Computer Graphics CourseNana.COM

Computer Lab Assignment #3, S1 2024 CourseNana.COM

Topic: Mesh Processing CourseNana.COM

Date Issued: see Wattle page Due Date: see Wattle page CourseNana.COM

Weighting: 12 CourseNana.COM

Instruction: CourseNana.COM

All homework assignments must be completed individually. We encourage you to discuss the assignments with other students. However, you should not share any of your codes with anyone else. Each student is responsible for implementing the assignment on their own. You may assist other in debugging their codes, but you should not copy and paste. ANU is using TurnItIn to detect possible duplications. Consulting with previous year students who enrolled in this course on specific assignment is also not allowed. You may use the internet as a resource for learning the materials, but you should not borrow any existing codes found online. CourseNana.COM

The homework assignments involve a significant amount of C++ programming. However, for most cases, a skeletal code base is provided, and you only need to fill in the missing parts, and/or fix bugs if any. CourseNana.COM

You will submit a single ZIP file as your submission, which must contain the following files: CourseNana.COM

  1. (1)  All source codes (ending in .h, or .hpp, or .cpp), and your Makefile, CMakeLists.txt. Please include all needed source codes for successful compilation. Please also remove all intermediate files (such as ./vs. ./build. ) that are not needed for the compilation – Failing to do so will lead to penalty to the marks. CourseNana.COM

  2. (2)  A written CLab3 Lab Report (minimum 10-point font size, single column, in PDF format, with task statement, methods used, any new features that you have implemented, any known bugs in your code, answer any questions that have been asked in the task, instruction for the tutor to use your code, example experiment results. ) CourseNana.COM

Your ZIP file must be named as “COMPX610 2024 HW3 UID.zip”. Replace ‘X’ with 4 or 8. Replace the UID with your Uxxxxxxxx; Please submit your ZIP file to Wattle before the deadline. Late submission will lead to penalty as per the ANU policy. Later-than-one-week submission will CourseNana.COM

not be accepted, which may result zero mark, unless a pre-approval for special consideration is obtained in written before the submission deadline. CourseNana.COM

In C-Lab-3, you will be practising how to efficiently process 3D meshes. Specifically, there are two tasks to complete: T1: half-edge data structure, and T2: mesh simplification. We provide the general code framework for completing these two tasks and it is highly recommended to use it. However, you’re also welcomed to build up your own pipeline as long as it satisfy all the requirements. CourseNana.COM

Task-1: half-edge data structure CourseNana.COM

In this task, you will build upon your knowledge of C++ and graphics by creating a half-edge data structure from interlinked pointers, and then compute important geometry and topology properties, and visualize your mesh using MeshLab or Blender. CourseNana.COM

Steps to take: CourseNana.COM

  1. (1)  Use the two OBJ meshes provided in ”model” folder (bigguy2.obj, teeth.obj) to conduct the following experiments and report their results. You are also welcomed to download other complex 3D meshes in OBJ file format from the internet to test your algorithms. Make sure that each of the meshes satisfies the following properties: CourseNana.COM

    The mesh contains a single connected component.
    The mesh must be watertight, i.e., a valid manifold surface that encloses a volume. CourseNana.COM

  2. (2)  Complete the following implementations in task1.cpp: CourseNana.COM

    • Load the mesh in OBJ file format and represent the loaded mesh in the memory by a half-edge data structure. In this step, you’ll need to implement the function Mesh::convert obj format to mesh(); CourseNana.COM

    • Iterate all half edges that points away from given vertex by implementing the function Vertex::neighbor half edges(); CourseNana.COM

    • Iterate all member vertices of given face by implementing Face::vertices(). CourseNana.COM

    • Compute its topology properties (genus number). You’ll have to implement the function CourseNana.COM

      Mesh::compute genus(); CourseNana.COM

    • Compute its volume by implementing Mesh::compute volume(); CourseNana.COM

    • Compute its surface areas by implementing Mesh::compute surface area() CourseNana.COM

    • Compute the average degree of all the vertices by implementing Mesh::compute average degree(). CourseNana.COM

  3. (3)  Your lab report should contain the following contents: 2 CourseNana.COM

  • Put the screenshot of the mesh represented by half-edge data structure CourseNana.COM

  • Brief introduction describing the process of your conversion (a pseudo-code will be best CourseNana.COM

    for clarification) CourseNana.COM

  • Show the geometric properties (e.g. number of vertices, faces, half-edges and edges) of the mesh as well as your topology computation results with the screenshot from the terminal output. CourseNana.COM

    Hint: CourseNana.COM

    Half-edge data structure consists of four basic components: Vertex, Face, HalfEdge, and Edge. The format of the half-edge data structure is outlined below, and basic class member variables are already provided in include/mesh components.hpp. (Additional member variables and member functions are used in task2, you can ignore it for now.) CourseNana.COM

    Reference guide: CourseNana.COM

    The Vertex class contains variables for the following information:
    CourseNana.COM

    A Vector3 for storing its (x, y, z) position;
    A pointer to one of the HalfEdges that points away from this Vertex; A unique integer identifier for the Vertex. CourseNana.COM

    The Face class contains variables for the following information: A pointer to one of the HalfEdges that lies on this Face; CourseNana.COM

    A unique integer identifier for the Face.
    The
    HalfEdge class contains variables for the following information: CourseNana.COM

  • A pointer to the next HalfEdge in the loop of HalfEdges that lie on this HalfEdge’s Face; CourseNana.COM

  • A pointer to the HalfEdge that lies parallel to this HalfEdge and which travels in the opposite direction and is part of an adjacent Face, i.e., this HalfEdge’s symmetrical HalfEdge; CourseNana.COM

  • A pointer to the Edge on which this HalfEdge represents; CourseNana.COM

  • A pointer to the Face on which this HalfEdge lies; CourseNana.COM

  • A pointer to the Vertex that this HalfEdge originates from; CourseNana.COM

  • A unique integer identifier for the HalfEdge. CourseNana.COM

    The Edge class contains variables for the following information:
    A pointer to one of the HalfEdges that represents this Edge; CourseNana.COM

    A unique integer identifier for the Edge. CourseNana.COM

    In your Lab report, you should clearly visualise the mesh, and list key results to demonstrate your solutions. CourseNana.COM

Task-2: Simplify the mesh using quadratic error metrics Purpose: CourseNana.COM

The goal of this task is to load a mesh and to simplify the mesh down to a specified number of triangles. You will learn about modern mesh simplification algorithms with a half-edge data structure. CourseNana.COM

Description: CourseNana.COM

In this task, we will perform mesh simplification algorithm based on quadric error metric (QEM), you may read the following paper for reference: https://www.cs.cmu.edu/ ̃./garland/Papers/quadrics.pdf CourseNana.COM

To perform surface simplification, you should use the half-edge data structure implemented in task1 to achieve a pair-contraction operator for the mesh. This pair-contraction operation should preserve the topology of the surface. CourseNana.COM

To reduce the difficulty of the implementation, we’ll simplify the algorithm in the original paper introduced as follows: CourseNana.COM

  1. (1)  When choosing valid pairs (v1,v2) and perform contraction, we only consider cases where (v1, v2) form an edge. Without loss of generality, we’ll use the term “pair contraction” and “edge collapse” interchangeably. CourseNana.COM

  2. (2)  We will not use the point-to-plane distance as discussed in the paper that computes the distance to adjacent planes to act as error metric, because degenerate cases may make the problem more difficult to solve. Instead, we will use distance to adjacent vertices with the derivation below. You should collapse edges in the order dictated by the error function below and place new vertices at the minimizer of this error function: CourseNana.COM

Let E(v) = Pni=1(v vi)2 be the error function associated with each vertex v of the mesh, where {vi, i = 1. . . n} are the neighbours of v. If we expand this quadratic, we find that E(v) = nvT v 2vT Pni=1 vi + Pni=1 viT vi, whose minimizer is given by v = Pni=1 vi/n. CourseNana.COM

We can further rewrite E(v) as vector dot product form, which is: E(v) = n Pni=1 vi Pni=1 viT viT vT v 2v 1. Therefore, all we need to store to represent CourseNana.COM

this quadratic is the coefficient q = n Pni=1 vi Pni=1 viT vi, which is a 5-d vector. CourseNana.COM

The benefit of this representation is that when creating the combined quadratic for the union of two vertices, we simply need to sum the two vectors, each containing 5 numbers, together for the two different vertices. CourseNana.COM

You should perform edge-collapse operations using the error function above until you achieve the desired number of polygons or there are no more edges that can be collapsed safely. The processing time must be below one minutes. Your report should display the original and simplified surface and also report the number of vertices, faces and edges respectively. CourseNana.COM

You must disallow edge collapses if they create illegal topology. While you should work independently, it is a good idea to compare your results with other students, to verify code correctness. You should assure in your input OBJ all the polygons are triangles and the input surface is closed. CourseNana.COM

Steps to take: CourseNana.COM

Perform mesh simplification in task2.cpp. We already provide the code framework for this function and all you need to do is to complete the missing functions as specified in the code. However, you’re also welcomed to implement the whole pipeline in your own way as long as it successfully achieves the simplification functionality and generate the same results. Complete the following functionalities: CourseNana.COM

  1. (1)  Vertex::compute qem coeff() to compute the coefficient vector q that represent the quadratic coefficient of this vertex. CourseNana.COM

  2. (2)  Edge::compute contraction() to compute the following results for this edge (v1, v2), which will be used later to perform edge collapse: CourseNana.COM

    The optimal contraction target v;
    5
    CourseNana.COM

CourseNana.COM

The quadratic error metrics E(v) which is the combined quadratic for the union of v1,v2. Note that the computed results will become the cost of contracting this edge. CourseNana.COM

(3) Edge::edge contraction() to perform edge-collapse, which we will write as (v1, v2) v. It contains the following steps: CourseNana.COM

  • Moves the vertex v1 to the new position v*, remember to update all corresponding attributes CourseNana.COM

  • Connects all incident edges of v1 and v2 to v*, and remove the vertex v2 CourseNana.COM

  • Any faces, half edges, and edges associated with this collapsed edge will be removed. CourseNana.COM

    (4) Your lab report should contain the following contents: CourseNana.COM

  • Use the two OBJ meshes provided in ”model” folder to demonstrate the results. CourseNana.COM

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
ANU代写,COMP4610代写,COMP8610代写,Computer Graphics代写,Mesh Processing代写,C++代写,ANU代编,COMP4610代编,COMP8610代编,Computer Graphics代编,Mesh Processing代编,C++代编,ANU代考,COMP4610代考,COMP8610代考,Computer Graphics代考,Mesh Processing代考,C++代考,ANUhelp,COMP4610help,COMP8610help,Computer Graphicshelp,Mesh Processinghelp,C++help,ANU作业代写,COMP4610作业代写,COMP8610作业代写,Computer Graphics作业代写,Mesh Processing作业代写,C++作业代写,ANU编程代写,COMP4610编程代写,COMP8610编程代写,Computer Graphics编程代写,Mesh Processing编程代写,C++编程代写,ANUprogramming help,COMP4610programming help,COMP8610programming help,Computer Graphicsprogramming help,Mesh Processingprogramming help,C++programming help,ANUassignment help,COMP4610assignment help,COMP8610assignment help,Computer Graphicsassignment help,Mesh Processingassignment help,C++assignment help,ANUsolution,COMP4610solution,COMP8610solution,Computer Graphicssolution,Mesh Processingsolution,C++solution,