20
Solid models and fractals COM3404 Richard Everson School of Engineering, Computer Science and Mathematics University of Exeter [email protected] http://www.secamlocal.ex.ac.uk/studyres/COM304 Richard Everson 1 / 24

Solid Fractals - University of Exeter

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Solid Fractals - University of Exeter

Solid models and fractalsCOM3404

Richard Everson

School of Engineering, Computer Science and MathematicsUniversity of Exeter

[email protected]

http://www.secamlocal.ex.ac.uk/studyres/COM304

Richard Everson 1 / 24

Page 2: Solid Fractals - University of Exeter

Outline

1 Constructive solidgeometry

2 Metaballs3 Fractals

DimensionExamplesLandscape generation

4 L-systems

References

Fundamentals of 3D Computer Graphics. Watt. Chapters 1 & 2Computer Graphics: Principles and Practice. Foley et al (1995).Fractal Geometry of Nature. Mandelbrot. (1988).

Richard Everson 2 / 24

Page 3: Solid Fractals - University of Exeter

Constructive solid geometry

Models constructed from primitives using “volumetric Boolean” operations

Primitives Cuboids, spheres,cylinders, prisms, cones.

Operations union,intersection, subtraction

Special algorithms(Goldfeather, SCS) forrendering the CSG withoutdirectly computing the 3Dobject representation.

http://en.wikipedia.org/wiki/Constructive solid geometry

Richard Everson 4 / 24

Page 4: Solid Fractals - University of Exeter

Constructive solid geometry

Representation Stored in an attributed tree

Nodes Combining operationLeaves Primitives

Logic The logic underlying the model is preserved in the tree.

Alteration Dimensions of primitives are easily altered.

Limitations

Limited range of operations to construct modelsDetailed modifications to a local region may bedifficult because Boolean operations are global:e.g., blending at joins is difficult.Specific rendering algorithms or conversion topolygon form

Richard Everson 5 / 24

Page 5: Solid Fractals - University of Exeter

Implicit functions and metaballs

r = (x , y , z)

Define a function f (r) on all of the modelling space.

Surface of a model is the contour or iso-surface

f (r) = const

Examplef (x , y) = (x − x0)

2 + (y − y0)2

f (x , y) = c2 defines a circle ofradius c centred at (x0, y0)

x0 = 1, y0 = 0.5, contour f (x , y) = 82

−10 −8 −6 −4 −2 0 2 4 6 8 10−10

−8

−6

−4

−2

0

2

4

6

8

10

40

60

80

100

120

140

160

180

200

Richard Everson 7 / 24

Page 6: Solid Fractals - University of Exeter

Metaballs

SourcesDefine potential function as asum of ‘sources’ with locationand strength.

−10 −8 −6 −4 −2 0 2 4 6 8 10−10

−8

−6

−4

−2

0

2

4

6

8

10

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Example

f (x , y) = exp{−[(x + 5)2 + (y + 5)2]/60

}+1.5 exp

{−[(x − 5)2 + (y − 5)2]/60

}Thick contour at f (r) = 0.8.

Richard Everson 8 / 24

Page 7: Solid Fractals - University of Exeter

Metaballs

Richard Everson 9 / 24

Page 8: Solid Fractals - University of Exeter

Metaballs

Negatively weighted sourcescan be used to sculptconcavities

−10 −8 −6 −4 −2 0 2 4 6 8 10−10

−8

−6

−4

−2

0

2

4

6

8

10

0

0.2

0.4

0.6

0.8

1

Example

f (x , y) = exp{−[(x + 5)2 + (y + 5)2]/60

}+1.5 exp

{−[(x − 5)2 + (y − 5)2]/60

}− exp

{−[x2 + (y − 4)2]/5

}Thick contour at f (r) = 0.8.

Richard Everson 10 / 24

Page 9: Solid Fractals - University of Exeter

Metaballs

Richard Everson 11 / 24

Page 10: Solid Fractals - University of Exeter

Fractals

Fractals

Objects that are self similar on a wide range of scales

Self similarWhen a component part isappropriately magnified itappears identical to the whole.

Koch curveSierpinski gasket

Approximately self similarMany naturally occurring objectsare statistically self-similar overa range of scales

Coast line of Great BritainCloudsAlveoli in lungs

Richard Everson 13 / 24

Page 11: Solid Fractals - University of Exeter

Generating fractals: Koch curve

Initiator The initial shape

Generator At each stage theinitiator is replace by a copy of thegenerator

Length at each stage is:

N = 1 L =(

43

)N = 2 L = (4/3)× 1

3 × 4 =(

43

)2

N = 3 L =(

43

)3

N L =(

43

)N

limN→∞ L(N) = ∞

Richard Everson 14 / 24

Page 12: Solid Fractals - University of Exeter

Dimension

Line Dimension of a line is 1because if it is divided into N partseach looks like the original scaled

down by N11

Plane Divide a square into N: each

looks like the original scaled by N12

Koch curve Each of the 4 pieces ofthe Koch curve looks like theoriginal scaled down by a factor 3.Dimension d

41/d = 3

d = log(4)/ log(3) = 1.26...

Fractals have non-integer dimension

Richard Everson 15 / 24

Page 13: Solid Fractals - University of Exeter

Examples

3D Sierpinski gaskets Julia set

Richard Everson 16 / 24

Page 14: Solid Fractals - University of Exeter

Fractal fern

Generated by repeated affine transformations.

Iterated function systems: Michael Barnsley “Fractals Everywhere”,Academic Press (1988).

Richard Everson 17 / 24

Page 15: Solid Fractals - University of Exeter

Recursive subdivision for meshes

Divide generator in two and displace vertically by a random amount

Divide triangular facet edges into two, forming 4 smaller facetsVertically displace the midpoints by random amountsRichard Everson 18 / 24

Page 16: Solid Fractals - University of Exeter

Fractal terrain

Naive methods tend to produce‘creases’; alleviated by usingoverlapping hexagonal grids.

In real landscapes the statisticalproperties of hills and valleysdiffer. Choose displacementsfrom an asymmetric distributionso that small displacements aremore probable.

Landscapes may have a manypolygons; problematic forrendering algorithms.

Richard Everson 19 / 24

Page 17: Solid Fractals - University of Exeter

Fractal terrain

Fractal terrain rendered with POV-Ray

Generated by fracplanet

See also terragen

Richard Everson 20 / 24

Page 18: Solid Fractals - University of Exeter

L-systems

Lindenmayer systems

Grammar to describe branching processes

Alphabet { A, B, [, ], (, ) }Production

A → AAB → A[B]AA(B)

1 A

2 AA

3 AAAA

1 B

2 A[B]AA(B)

3 AA[A[B]AA(B)]AAAA(A[B]AA(B))

Associate [. . .] with a left branch

Associate (. . .) with a right branch

Richard Everson 22 / 24

Page 19: Solid Fractals - University of Exeter

L-systems

B

B

A

A

A

B

B

B

B

B

A

A

A

A

A

A

A

A

AA

A

A

A[B]AA(B)

AA[A[B]AA(B)]AAAA(A[B]AA(B))

Richard Everson 23 / 24

Page 20: Solid Fractals - University of Exeter

L-system trees

Rich alphabets

Symbols only become effective at later stages of production

Randomised variations in geometric interpretation of symbols, e.g.branching angles, width of cylinders forming trunks.

Richard Everson 24 / 24