Chapter 9: Recursive Methods and Fractals E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides by Edward Angel and Dave Shreiner
Modeling Geometric: – Meshes. – Hierarchical. – Curves and Surfaces. Procedural: – Particle Systems. – Fractal. E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
Sierpinski Gasket Rule based: Repeat n times. As n →∞ Area→0 Perimeter →∞ Not a normal geometric object. E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
Coastline Problem What is the length of the coastline of England? Answer: There is no single answer. Depends on length of ruler (units). If we do experiment with maps at various scales we also notice self-similarity: each part looks a whole. E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
Fractal Geometry Created by Mandelbrot: – Self similarity. – Dependence on scale. Leads to idea of fractional dimension. Graftals: graphical fractal objects. E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
Koch Curve/Snowflake E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
Fractal Dimension Start with unit line, square, cube which we agree are 1, 2, 3 dimensional respectively. Consider scaling each one by a h = 1/n. E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
How Many New Objects? Line: n. Square: n 2. Cube: n 3. The whole is the sum of its parts, i.e., fractal dimension (d) is given by: 8 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 = 1 d =
Examples Koch curve: – Subdivision (i.e., scale) by 3 each time. – Create 4 new objects. – d = ln 4 / ln 3 = Sierpinski gasket: – Subdivide (scale) side by 2. – Keep 3 of the 4 new triangles, i.e., create 3 new objects. – d = ln 3 / ln 2 = E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
Volumetric Examples E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley d = ln 4/ ln 2 = 2 d = ln 20 / ln 3 =
Midpoint subdivision E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Randomize displacement using a Gaussian random number generator. Reduce displacement in each iteration by reducing variance of generator.
Fractal Brownian Motion E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Variance ~ length -(2-d) Brownian motion d = 1.5
Fractal Mountains E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Use fractals to generate mountains and natural terrain. Tetrahedron subdivision + midpoint displacement. Control variance of random number generator to control Roughness. Can apply to mesh surfaces too!
Mandelbrot Set Based on fractal geometry. Easy to generate but models infinite complexity in the shapes generated. Based on calculations in the complex plane. E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
Mandelbrot Set Iterate on z k+1 =z k 2 +c with z 0 = 0 + j0. Two cases as k →∞: |z k |→∞ |z k | remains finite; If for a given c, |z k | remains finite, then c belongs to the Mandelbrot set. E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
Mandelbrot Set E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
Mandelbrot Set E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley
More Details Section 9.8: fractals and recursive methods. Section 9.9: procedural noise. E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley