The Subdivision Surfaces Homework is based on the two replacement lectures last week. You can find further information at Eriks notes.
- Update the project mvws1400
- Copy the mathvis.Viewer.java to your project
- Copy the 5 subdivisionplugins mathvis.plugin.SubdivPlugin to your pluginpackage
- ButterflyPlugin
- CatmullClarkPlugin
- DooSabinPlugin
- LoopPlugin
- Sqrt3Plugin
At the execute-Method of each SubdivisionPlugin you will find the following structure:
- Given: HalfEdgeDataStructure (V,E,F,HDS) hds, AdapterSet a, HalfedgeInterface hcp
- The triangle-based Subdiv-schemes call then a triangulate-method (hds, a). You have to write this triangulate-function.
- As next step the classes generate a second HalfEdgeDataStructure hds2
- Then they call the subdivide-method (hds, hds2, a)
- And finally set the new hds2 online hcp.set(hds2)
Triangulate-Method:
- check if needed!
- triangulate either stellar or “general”, if stellar do not triangulate triangles.
Sudbivision-Method:
For all Schemes, except for DooSabin, create a combinatorial copy of the first mesh:
- hds.createCombinatoriallyEquivalentCopy(hds2);
- Attention this Method is only combinatorial, so there are no positions set!
- add new combinatorics to hds2
- calculate new Vertex Positions Q and P (for hds2) out of the old positions V (from hds) as described in the lecture. Therefore you need the Adapterset a:
- Here comes a small example setting the old Vertex Positions V as the new Vertex Positions P:
- for (V v : hds. getVertices()) {
- double[] position = a.get(Position.class, v, double[].class)
- int idx = v.getIndex()
- V nv = hds2.getVertex(idx);
- a.set(Position.class, nv, position);
- }
- for (V v : hds. getVertices()) {
Tuesday Submission (02.12):
- CatmullClark
- Sqrt3-Kobbelt (don’t forget the edgeflips in the end)
- Butterfly
Thursday Submission (04.12):
- DooSabin
- Dyadic-Loop
- Butterfly