![Page 1: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/1.jpg)
CS559: Computer Graphics
Lecture 36: Subdivision Surfaces, Fractals, and AnimationLi Zhang
Spring 2008
Many slides from James Kuffner’s graphics class at CMU
![Page 2: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/2.jpg)
Today• Shape Modeling => animation
• Reading• Real‐Time Rendering, 3e, 13.5.4, 13.5.5 (subdivision surfaces)
• Linux: /p/course/cs559‐lizhang/public/readings/ 13_surfs_gleicher.pdf
• Windows: P:\course\cs559‐lizhang\public\readings\13_surfs_gleicher.pdf
• (Optional) Computer Rendering of Stochastic Models, Commof ACM, June, 1982, p371‐384
• Linux: /p/course/cs559‐lizhang/public/readings/p371‐fournier.pdf• Windows: P:\course\cs559‐lizhang\public\readings\p371‐fournier.pdf
• (Optional) Shirley, ch 16, overview of animation
![Page 3: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/3.jpg)
Basic Steps of Subdivision Surfaces
Loop Subdivision
Sqrt(3) Subdivision
![Page 5: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/5.jpg)
Catmull‐Clark Subdivision• Work for arbitrary polygons, not limited to triangles
• Used by Pixar in Geri’s game, toy story2 and all subsequent featues
![Page 6: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/6.jpg)
Catmull‐Clark Subdivision
Regular vertices: valence = 4
After first insertion, we only have quads in the mesh
![Page 7: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/7.jpg)
Catmull‐Clark Subdivision
C2 for regular verticesC1 for irregular vertices
For each face, add a new vertex at its centroid
For each old vertex, update
For each edge, add an new vertex
![Page 8: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/8.jpg)
Example
Academy Award for Technical Achievement in 2006.
![Page 9: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/9.jpg)
Standard subdivision is not enough
![Page 10: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/10.jpg)
Standard subdivision
![Page 11: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/11.jpg)
Piecewise smooth subdivision
Crease: a smooth curve on the surface, where the continuity across the curve is C0.
A dart is a vertex where a crease ends and smoothly blends into the surface.
A corner is a vertex where three or more creases come together
Crease
Dart
Corner
![Page 12: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/12.jpg)
Semisharpness
Derose et al, Subdivision Surfaces in Character Animation, SIGGRAPH 1998
![Page 13: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/13.jpg)
Semisharpness
Derose et al, Subdivision Surfaces in Character Animation, SIGGRAPH 1998
![Page 14: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/14.jpg)
Piecewise smooth subdivision
![Page 15: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/15.jpg)
Procedural Shape Modeling
Simple procedure
![Page 16: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/16.jpg)
Procedural Terrain Modeling
• Has a gross structrure• Also with some randomness• Want a height map z=h(x,y)
F.K. Musgrave
![Page 17: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/17.jpg)
1D case
Start with a single horizontal line segment. Repeat for a sufficiently large number of times {
Find the midpoint of the line segment. Displace the midpoint in Y by a random amount.Recursively apply this operation for the resulting two segments
with reduced range for the random numbers (by a factor 0<f<1). }
Want a function y=h(x)
![Page 18: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/18.jpg)
1D case
Start with a single horizontal line segment. Repeat for a sufficiently large number of times {
Find the midpoint of the line segment. Displace the midpoint in Y by a random amount.Recursively apply this operation for the resulting two segments
with reduced range for the random numbers (by a factor 0<f<1). }
Results with different f
Want a function y=h(x)
![Page 19: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/19.jpg)
2D case
• Subdivide and Displace
15-462 Graphics I, CMU, James Kuffner
![Page 20: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/20.jpg)
2D case
• Subdivide and displace– Seed corners with values
– Perturb midpoint randomly
– Recurse using a smaller window
– In 2D, best to use “diamond‐square” recursion
square diamond Recuse
15-462 Graphics I, CMU, James Kuffner
![Page 21: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/21.jpg)
2D case
F.K. Musgrave
![Page 22: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/22.jpg)
Texture mapping
F.K. Musgrave
![Page 23: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/23.jpg)
Adding water
• Use an elevation threshold (z < z_water)
F.K. Musgrave
![Page 24: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/24.jpg)
![Page 25: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/25.jpg)
![Page 26: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/26.jpg)
Fractal Plants (L‐Systems)
• Uses “production rules” applied to a seed “axiom”
• Example:
Axiom: B
Rule: B‐>ABB
![Page 27: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/27.jpg)
L‐system Example
![Page 28: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/28.jpg)
L‐systems example: Koch snowflake
How to make the flake look less regular?
![Page 29: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/29.jpg)
L‐systems example: Serpinski Triangle
![Page 30: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/30.jpg)
Procedural Trees and Bushes
• Define a branch structure
• Define a leaf
![Page 31: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/31.jpg)
Algorithmic Plants
• excellent web resource with free online book: http://algorithmicbotany.org/
• Numerous papers by Przemyslaw Prusinkiewicz and colleagues
![Page 32: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/32.jpg)
Procedural Trees from PovTree
http://propro.ru/go/Wshop/povtree/tutorial.html
![Page 33: CS559: Computer Graphicspages.cs.wisc.edu/~lizhang/courses/cs559-2008s/syllabus/04-23-sha… · CS559: Computer Graphics Lecture 36: Subdivision Surfaces, Fractals, and Animation](https://reader030.vdocuments.us/reader030/viewer/2022040601/5e91c0c16089213f851ce418/html5/thumbnails/33.jpg)
Interactive Fractal Tree Design