The original mesh (genus 1 torus), and the mesh after one subdivision (Loop scheme) |
The mesh after some subdivision rounds |
Files to download todayHere are some files to download (and extract to the main folder of your Eclipse project):
Libraries to add (project /LIB):
For the simplification and rendering of meshes:
TD5 documentation: instructions
|
class MeshViewer |
|
|
Class MeshViewer
provides simple methods for drawing a surface
mesh in a 3D frame; it also provides a simple
trackball (allowing to rotate the 3D scene with
mouse events).
You can choose three distinct rendering modes (as illustrated below): press 'r' key (on the keyboard) in order to change rendering mode. Method setup() allows to select the preferred subdivision scheme: press 's' key (on the keyboard) in order to run the subdivision procedure.
|
Suggestion: in order to implement
the Loop subdivision scheme, we suggest to you to follow the
steps below (feel you free in choosing and implementing a
different solution)
1.1 compute edge point coordinates
|
|
1.2 split edges by inserting edge points
Now we want to insert edge vertices: just use splitEdge(Halfedge<X>
h) operator (already implemented in Jcg).
|
Splitting edges |
1.3 subdivide faces
In order to subdivide each face (of degree 3+3) into 4
triangle faces, you can perform three splitFace()
operations (see slides for TD5). |
Subdividing faces |
1.4 compute new locations for original vertices
To conclude, it only remains to compute the final new
locations of vertices of the original mesh. |
One round subdivision |
2.0 A subdivision scheme for polygonal meshes
Given a triangle mesh (class Polyhedron_3<Point_3>),
we want to subdivide it, by computing the Catmull-Clark
subdivision (see slides for TD5). |