IlliDOL: A Framework for Exploration of L- Systems in Three Dimensions Vilas Dhar [email protected] Math...

25
IlliDOL: A Framework for Exploration of L-Systems in Three Dimensions Vilas Dhar [email protected] Math 198 Spring 2003

Transcript of IlliDOL: A Framework for Exploration of L- Systems in Three Dimensions Vilas Dhar [email protected] Math...

IlliDOL:

A Framework for Exploration of L-Systems in Three Dimensions

Vilas Dhar [email protected] Math 198

Spring 2003

What are Lindenmeyer Systems?

• Class of string rewriting mechanisms originally used to model plant development

• Arose from an interest in formal grammars proposed by Chomsky

• Different from Chomsky grammars in that successive productions are applied in parallel

A simple L-system consists of 4 elements:

1. VARIABLES are symbols denoting elements that can are replaced.

2. CONSTANTS are symbols denoting elements that remain fixed.

3. INITIATOR is the start position of the system

4. RULES ("syntax") define how the variables are to be replaced by constants or other variables.

Example

Variables: A B

Constants: none

Initiator: A

Rules: A -> B

B -> AB

Example (con’t)

Stage 0 : A

Stage 1 : B

Stage 2 : AB

Stage 3 : BAB

Stage 4 : ABBAB

Stage 5 : BABABBAB

Stage 6 : ABBABBABABBAB

Stage 7 : BABABBABABBABBABABBAB

Example (con’t)

Stage 0 : A 1

Stage 1 : B 1 Stage 2 : AB 2 Stage 3 : BAB 3 Stage 4 : ABBAB 5 Stage 5 : BABABBAB 8 Stage 6 : ABBABBABABBAB 13 Stage 7 : BABABBABABBABBABABBAB 21

Fibonacci sequence!

String Interpretation – Turtle Geometry

A simple model:

State: (x,y,alpha)

Commands:F: Move forward step of length d

f: Move forward step of length d, do not draw a line

+: Turn left by angle delta

-: Turn right by angle delta

A Familiar Figure

Number of Iterations =4, delta = 60 Degrees

Initial State: Fr

Rules: Fl -> Fr+Fl+Fr

Rules: Fr -> Fl-Fr-Fl

Growing Things!

• Start with the string G

• Use the following rules:F -> FF

G -> F[+G][-G]F[+G][-G]FG

Strings Strings Strings!

Stage 1: G

Stage 2: F[+G][-G]F[+G][-G]FG

Stage 3: FF[+F[+G][-G]F[+G][-G]FG][-F[+G][-G]F[+G][-G]FG]FF[+F[+G][-G]F[+G][-G]FG][-F[+G][-G]F[+G][-G]FG]FFF[+G][-G]F[+G][-G]FG

Plants?Take the preceding string and apply two simple rules. Every G becomes a

green short branch, and every F becomes a longer brown branch, and define the turning angle as 25 degrees. Here’s what we end up with:

Turtle Geometry in 3D

Turtle State:H, L, U -- unit length perpendicular vectors

Rotations are represented by:

[H’,L’,U’] = [H,L,U] R

Where R is a 3x3 matrix – Specifically:

Rotation Matrices

| cos(alpha) sin(alpha) 0 | RU (alpha ) = | -sin(alpha) cos(alpha) 0 |

| 0 0 1 |

| cos(alpha) 0 - sin(alpha) | RL(alpha ) = | 0 1 0 |

| sin(alpha) 0 cos(alpha) |

| 1 0 0 | RH (alpha ) = | 0 cos(alpha) –sin(alpha) |

| 0 sin(alpha) cos(alpha) |

New Turtle Commands

+ : turn left by angle using RU(alpha)- : turn right by angle using RU(-alpha)

& : Pitch up by angle using RL(alpha)

^ : Pitch down by angle using RL(-alpha)

\ : Roll left by angle using RH(alpha)

/ : Roll right by angle using RH(-alpha)

| : Turn around, using rotation matrix RU(180 deg)

What can this turtle do?

More Turtles!

Growing 3D Things

Start with a string A with the following rules:

A-> [&FL!A]/////’ [&FL!A]///////’ [&FL!A]

F -> S/////F

S - > F L

L-> [‘’’^^{-f+f+f-|-f+f+f}]

A represents an apex, L a leaf, F an edge

Applying the rules for 3 repetitions gives us:

IlliDOL: A Framework for Exploration

The goal of IlliDOL is to allow the novice user to explore L-system based processes in 3 dimensions with as little training as possible.

IlliDOL components

• A point and click toolkit for string and rule creation.

• A grammar parser that takes an axiom and rules to generate strings at every level of iteration.

• A graphical environment based on illiSkel which converts strings into real figures. This environment will be expandable by users to generate variable phenomena.

Project Timeline

• By May 2003:A parser which generates strings based on user-

supplied rules.Hilbert Curve, generated via L-systems and displayed in the CAVE.Bush structure with user definable parameters growing on CAVE floor through at least 4 iterations

For More Information

General Info:

Prusinkiewicz, Lindenmeyer, “The Algorithmic Beauty of Plants” Springer Verlag, 1990

Applications:

http://www.gressly.ch/systems/projects/vp/

http://instruct1.cit.cornell.edu/courses/bionb441/LSystem/

Evolutionary Approaches:

http://www.csse.monash.edu.au/~jonmc/resources/L-systems-evol.pdf

Pretty Pictures

http://www-viz.tamu.edu/courses/viza615/97spring/benc/research/img12.jpg

http://www-viz.tamu.edu/courses/viza615/97spring/benc/research/img4.jpg

http://www-viz.tamu.edu/courses/viza615/97spring/benc/research/img13.jpg