CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

17
CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel

Transcript of CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Page 1: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

CS4395: Computer Graphics 1

Fractals

Mohan SridharanBased on slides created by Edward Angel

Page 2: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Modeling

• Geometric:– Meshes.– Hierarchical.– Curves and Surfaces (coming up soon!).

• Procedural:– Particle Systems.– Fractal.

CS4395: Computer Graphics 2

Page 3: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Sierpinski Gasket

• Rule based:

• Repeat n times. As n →∞:– Area→0– Perimeter →∞

• Not a normal geometric object.

CS4395: Computer Graphics 3

Page 4: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Coastline Problem

• What is the length of the coastline of England?

• There is no single answer:– Depends on length of ruler (units).

• If we experiment with maps at various scales we also notice self-similarity: each part looks like a whole!

CS4395: Computer Graphics 4

Page 5: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Fractal Geometry

• Created by Mandelbrot:– Self similarity.– Dependence on scale.

• Leads to the idea of fractional dimension.

• Graftals: graphical fractal objects.

CS4395: Computer Graphics 5

Page 6: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Koch Curve/Snowflake (Figure 11.12)

CS4395: Computer Graphics 6

• Recursive lengthening:

• In the limit, infinite length and discontinuous first derivative.• Not a 2D object either!

Page 7: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Fractal Dimension• Start with unit line, square, cube which we agree are 1D, 2D,

3D respectively under any reasonable dimension.

• Consider scaling each one by a h = 1/n, the smallest unit we can measure.

• Scale object by h and replicate k times.

CS4395: Computer Graphics 7

Page 8: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

How Many New Objects?

• Line: k = n

• Square: k = n2

• Cube: k = n3

• The whole is the sum of its parts implies:

8CS4395: Computer Graphics

ndk

= 1 n

k

ln

lnd =

Page 9: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Examples

• Koch Curve:– Sub-division (scaling) of the original by a factor of 3.– Create 4 new objects.– Fractal dimension: d = ln 4 / ln 3 = 1.26186.

• Sierpinski gasket:– Sub-division (scaling) by a factor of 2.– Keep 3 of the 4 triangles created.– d = ln 3 / ln 2 = 1.58496.

CS4395: Computer Graphics 9

Page 10: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Volumetric Examples

CS4395: Computer Graphics 10

• 3D version of Sierpinski gasket:• d = ln 4/ ln 2 = 2.

• One iteration of the sponge:• d = ln 20 / ln 3 = 2.72683.

Page 11: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Midpoint subdivision

CS4395: Computer Graphics 11

Randomize displacement using a Gaussian random number generator. Reduce displacement each iteration by reducing variance of generator.

Page 12: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Fractal Brownian Motion

CS4395: Computer Graphics 12

variance ~ length -(2-d)

Brownian motion d = 1.5

Page 13: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Fractal Mountains

CS4395: Computer Graphics 13

Page 14: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Iteration in the Complex Plane

CS4395: Computer Graphics 14

Page 15: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Mandelbrot Set

• Iterate on zk+1=zk2+c with z0 = 0 + j0

• Two cases as k →∞:– |zk |→∞– |zk | remains finite.

• If for a given c, |zk | remains finite, then c belongs to

the Mandelbrot set.

CS4395: Computer Graphics 15

Page 16: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Mandelbrot Set (Section 11.8.5)

CS4395: Computer Graphics 16

Page 17: CS4395: Computer Graphics 1 Fractals Mohan Sridharan Based on slides created by Edward Angel.

Mandelbrot Set

CS4395: Computer Graphics 17