SCRIPTING AND CONSTRUCTION THREE DIMENSIONAL TREE By Ryan Pierce and Marco Rathjen.

16
SCRIPTING AND CONSTRUCTION THREE DIMENSIONAL TREE By Ryan Pierce and Marco Rathjen

Transcript of SCRIPTING AND CONSTRUCTION THREE DIMENSIONAL TREE By Ryan Pierce and Marco Rathjen.

SCRIPTING AND CONSTRUCTION

THREE DIMENSIONAL TREE

By Ryan Pierce and Marco Rathjen

Goal

Set out to discover algorithms for building pre-rendered, relatively realistic tree systems for use in 3D modeling.

L-Systems

Lindenmayer Systems

Introduced in 1968 by Astrid Lindenmayer, a Hungarian theoretical biologist and botanist.

Used to model the behavior of plant cells and subsequent plant development.

Also, fractals.

Parametric L-Systems

Parametric L-Systems are defined as a tuple:

G = (V, ω, P)

V is the alphabet, basically a set of strings that are used as variables.

ω is the initiator, a string of several initial conditions

P is a set of production rules defining the system’s growth.

Basic L-System (Algae)

ω = A

n = 0: A

n = 1: AB

n = 2: ABA

n = 3: ABAAB

n = 4: ABAABABA

n = 5: ABAABABAABAAB

n = 6: ABAABABAABAABABAABABA

Alphabet -> V: A, BAxiom - > ω: AProduction Rules -> P:

(A-> AB) (B-> A)

Sierpinski Triangles (n=2, 4, 6, 8)

Square Koch (n=3)

Dragon Curve (n=10)

Basic L-Systemshttp://www.kevs3d.co.uk/dev/lsystems/ - Demos

Fractal Plant System

(n=6, angle=25 degrees)

Turtles

A turtle has:a locationan orientationa pen

Dielectric Breakdown Model

Simulates branching pattern that occurs during electrical discharge.

Breakdown occurs when an insulator (dielectric) is converted into a conductor.

Given a grid G, growing an aggregate by size n takes at best O(n * G^1.5)

G is especially large in 3D

1.) Calculate electric potential φ on a regular grid.2.) Select grid cell as growth site based on φ.3.) Add growth site to boundary condition.4.) Repeat until desired aggregate is obtained.

Modern Algorithms

Space Colonization Laplacian Growth

Various Laplacian Growth techniques

Modern Algorithms

Space Colonization Laplacian Growth

a. Attraction pointsb. Closest nodesc. Normalized vectord. Adding vectors and

normalizinge. Lateral branching/extending

main axisf. Neighborhood of g. Removing attraction pointsh. Closest nodes

Initial:1. Insert a point charge at the

origin.2. Locate the candidate sites

around charge (8 or 26 neighbors)

3. Calculate potential at each site according to the above equation.

Recursive:1. Randomly select weighted

growth site according to preferences.

2. Add new point charge to site.3. Update potential at all

candidate sites.4. Add new candidate sites.5. Calculate potential at new

candidate sites using equation.

Space Colonization

Competition for space N attraction points (hundreds or thousands) & one or more

tree nodes Influence when point and closest node is within radius of

influence Tree node: Points of influence: if is not empty create new

node attach to

Direction: the average of the normalized vectors towards all sources

Space Colonization

Space Colonization Laplacian Growth

Runtime: O(n) for attraction point calculation

More “convincing” for mature trees

Simulates fight for resources during growth

Wide variety of shapes with small parameter set, and little variation of algorithm

Runtime: O(n2)Memory: O(n) where n is

the number of growth sites in the final aggregate.

Extra negative charges can be inserted to stunt or encourage growth

Allows for global simulations (light, wind)

Space Colonization vs. Laplacian Growth

For the Test!

Know the three basic parts of an L-System:

Alphabet, Initiator, and Production Systems(aka Variables, Initial Conditions, and Rules)

Sources

Images/L-Systems:http://en.wikipedia.org/wiki/L-system

Laplacian Growth:http://scholar.google.com/scholar_url?hl=en&q=https://www.mat.ucsb.edu/Publications/tkim_laplacian_small.pdf&sa=X&scisig=AAGBfm10e7evR4QcXYO8KKlKcecPyQGRWA&oi=scholarr

Space Colonization:http://algorithmicbotany.org/papers/colonization.egwnp2007.html