150 likes | 266 Views
Programming assignment. You need to implement the following: Display basic mesh Information Find the number of vertices, edges, faces, boundaries, and compute Euler characteristic and number of genus Corresponding to function Mesh::DisplayMeshInfo() Compute normal at each vertex
E N D
Programming assignment • You need to implement the following: • Display basic mesh Information • Find the number of vertices, edges, faces, boundaries, and compute Euler characteristic and number of genus • Corresponding to function Mesh::DisplayMeshInfo() • Compute normal at each vertex • Corresponding to function Mesh::ComputeVertexNormals() • Compute mean curvature at each vertex • Corresponding to function Mesh::ComputeVertexCurvatures()
Programming assignment • Explicit umbrella smoothing • Corresponding to function Mesh::UmbrellaSmooth () • Implicit umbrella smoothing • Corresponding to function Mesh::ImplicitUmbrellaSmooth ()
Wavefront OBJ file format comment coordinates of vertex 1 three vertices of each face counter-clockwise order as you look at the face from outside v2 v1 v4 v3
How to modify program arguments 1) Select the menu item “Project Property”
How to modify program arguments 2) Select the “Debugging” tag 3) Type your arguments here 4) Press enter to comfirm
Normal at a vertex 0 t1 • From Siggraph 2000 subdivision course notes, the normal vector at an interior vertex of valence k can be computed as t1 x t2, where ti are tangent vectors computed as: • Example: for valence four, the masks are [1, 0, –1, 0] and [0, 1, 0, –1]. 1 -1 0 1 t2 0 0 -1 Masks for valence four
Normal at a vertex • At a boundary vertex p with valence k, the normal is computed as talong x tacross computed as follows: pk-1 p p1 p0
Mean curvature at a vertex • From Siggraph99 Desbrun et al , the discrete mean curvature at an interior vertex p with valence k can be computed as the L2-norm of p pj where A is the sum of areas of all the triangles sharing the vertex p p pj-1 one term of the summation, corresponding to edge p pj pj Pj+1
Explicit Umbrella Smoothing • Fairing operator • In matrix form • In your implementation you do not need to build the matrix Drawbacks: small time step for large mesh slow Where t is time stamp
Implicit Umbrella Smoothing • Explicit updating • Allows large time step • In your implementation setting to 1 is okay • You can use biconjugate gradient (BCG) method to solve the linear system You need to solve a sparse linear system
Sparse Linear System • You need to build the sparse linear system by create a Matrix object • Use Matrix::AddElement to add an element • Use Matrix::SortMatrix to sort the elements after adding all of them • You need to implement the function Matrix::BCG() to solve the linear system • Use Matrix::Multiply to compute b = Ax • Use Matrix::PreMultiply to compute bT = xTA
Using Boundary Half-edge • For open meshes, you can also maintain boundary half-edges such that the searching and updating will be much more easy. (every things are circular list, also no need to handle NULL pointers) • Here the boundary half-edges are shown in red as the triangles are being loaded.
Useful Classes and Functions • Classes OneRingHEdgeand OneRingVertex provide an interface to access the one-ring neighboring half-edges and vertices of a given vertex. • Function Vertex::Valence() let you know the valence (# of neighboring vertices) of a vertex.
Rendering in OpenGL (Flat) One normal for a triangle
Rendering in OpenGL (Smooth) One normal for each vertex