L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and...
Transcript of L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and...
![Page 1: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/1.jpg)
L-Systems
![Page 2: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/2.jpg)
Procedural ModelingIdea: Detailed
meshes are hard to build by hand, so let’s create a function that builds out meshes for us
Same idea as Perlin noise but in 3D!
![Page 3: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/3.jpg)
Another Example: Fractals
Iterated function system leads to infinite detail
![Page 4: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/4.jpg)
4D Fractals
Can be created using quaternions
https://www.youtube.com/watch?v=eS7qCfttmBk
![Page 5: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/5.jpg)
Turtle Graphics• Graphics system
implemented in LOGO (1967)
• Cursor is “turtle” with position and orientation
• Code moves turtle, creating a line trail
![Page 6: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/6.jpg)
Turtle Graphics
Simple code generates very complex results
![Page 7: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/7.jpg)
L-Systems• Recursive definition of an object using a
string rewriting system and formal grammar
• Invented by botanist, Aristid Lindenmayer• Designed to model plants• Przemyslaw Prusinkiewicz brought
concepts to graphics
![Page 8: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/8.jpg)
L-System Definition
Axiom: Starting stringVariables: Set of symbols to be rewritten
according to rulesTerminals: Set of symbols that have no
rewriting rulesRules: Set of substitutions possible for
variables
![Page 9: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/9.jpg)
Using L-Systems in Graphics
1. Associate actions (e.g. draw line, rotate, etc) with each variable and terminal
2. Recursively expand the axiom n times1. Execute actions of resulting string2. Generate image from string
![Page 10: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/10.jpg)
Example: Koch Curve
Rule:F = F-F++F-F
F: Draw line segment scaled by 1/3
-: Turn 60° left+: Turn 60° right
![Page 11: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/11.jpg)
Example: 2D Tree
![Page 12: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/12.jpg)
Parameterized L-SystemsAction specified by symbol can be
parameterized:
![Page 13: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/13.jpg)
Parameterized L-Systems
Not just parameterized symbols!
• Randomized rule-selection• Parameterization based on depth• Changes in parameters over time
![Page 14: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/14.jpg)
L-System Examples
![Page 15: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/15.jpg)
SpeedTreeLeading vegetation generator:http://www.speedtree.com/
https://www.youtube.com/watch?v=N2wmmdKzp8E
TreeIt (a free L-System I use):http://www.evolved-software.com/treeit/treeit
![Page 16: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/16.jpg)
Generating CitiesSame idea with different symbols and rules
• Good idea to having working understanding of the modeled system
https://graphics.ethz.ch/Downloads/Publications/Papers/2001/p_Par01.pdf
![Page 17: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/17.jpg)
City Generation
What are the “rules” for generating a city?
![Page 18: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/18.jpg)
City Generation
What are the “rules” for generating a city?
Based on terrain, types of buildings and plots, population, architecture style, and city history (i.e. planned versus sprawling)
![Page 19: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/19.jpg)
Example: Home Free
https://www.youtube.com/watch?v=ahBSQrX1yOE
![Page 20: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/20.jpg)
Example: Infamous
![Page 21: L-Systems · L-Systems • Recursive definition of an object using a string rewriting system and formal grammar • Invented by botanist, Aristid Lindenmayer • Designed to model](https://reader036.fdocuments.us/reader036/viewer/2022071006/5fc3a396a26cc40cd67f2cd3/html5/thumbnails/21.jpg)
Additional Reading
http://algorithmicbotany.org/papers/graphical.gi86.pdf
http://algorithmicbotany.org/papers/