Simulating Trees with Fractals and L-Systems Eric M. Upchurch CS 579.

Slides:



Advertisements
Similar presentations
JYC: CSM17 BioinformaticsCSM17 Week 8: Simulations (part 2): plant morphology sea shells (marine molluscs) fractals virtual reality –Lindenmayer systems.
Advertisements

ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
L-System Aristid Lindenmayer (1968), biologist. L-System A method of constructing a FRACTAL that is also a MODEL for plant growth. The Computational Beauty.
Shared Graphics Skills Cameras and Clipping Planes
Chapter 31 Images.
Binary Trees, Binary Search Trees CMPS 2133 Spring 2008.
Chapter 23 Mirrors and Lenses.
Chapter 23 Mirrors and Lenses. Medical Physics General Physics Mirrors Sections 1–3.
Chapter 23 Mirrors and Lenses.
SCRIPTING AND CONSTRUCTION THREE DIMENSIONAL TREE By Ryan Pierce and Marco Rathjen.
Lecture 23 Mirrors Lens.
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
L systems (Aristid Lindenmayer)
L-systems Presented by Luv Kohli COMP258 October 30, 2002 Images copyright © 1992 D. Fowler, P. Prusinkiewicz, and J. Battjes.
Fractal Image Compression
-1- Programming Project #1 (Moldels of Computation, Spring, 2001) Due: Section 1: March 1 (Thursday) Section 2 : March 2 (Friday) We know that formal languages.
Validating Streaming XML Documents Luc Segoufin & Victor Vianu Presented by Harel Paz.
79 Regular Expression Regular expressions over an alphabet  are defined recursively as follows. (1) Ø, which denotes the empty set, is a regular expression.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Normal forms for Context-Free Grammars
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
Data Structures Using C++ 2E Chapter 11 Binary Trees and B-Trees.
Holt Geometry 12-Ext Using Patterns to Generate Fractals 12-Ext Using Patterns to Generate Fractals Holt Geometry Lesson Presentation Lesson Presentation.
Approaches To Infinity. Fractals Self Similarity – They appear the same at every scale, no matter how much enlarged.
Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 9.7 Non-Euclidean Geometry and Fractal Geometry.
"Clouds are not spheres, mountains are not cones, coastlines are not circles, and bark is not smooth, nor does lightning travel in a straight line."(Mandelbrot,
Morphogenesis and Lindenmayer Systems (L-systems) Gabriela Ochoa
IlliDOL: A Framework for Exploration of L- Systems in Three Dimensions Vilas Dhar Math 198 Spring 2003.
Chapter 9: Geometry.
Dragon Curve Drawn in Project 4… How to generate the string of drawing commands? How does the dragon curve come about? 1.
The Elements and Principles of Art
Graphics Graphics Korea University cgvr.korea.ac.kr Model Construction 고려대학교 컴퓨터 그래픽스 연구실.
Model Construction 김 성 남. Contents What is Modeling? Model Construction - Interactive modeling tools - Scanning tools - Computer vision -
L-Systems and Procedural Plants CSE 3541 Matt Boggus.
College of Computer and Information Science, Northeastern UniversityOctober 13, CS U540 Computer Graphics Prof. Harriet Fell Spring 2007 Lecture.
The Artificial Life of Plants Przemyslaw Prusinkiewicz, Mark Hammel, Radom´ır Mˇech Department of Computer Science University of Calgary Calgary, Alberta,
Ch 9 Infinity page 1CSC 367 Fractals (9.2) Self similar curves appear identical at every level of detail often created by recursively drawing lines.
Examining the World of Fractals. Myles Akeem Singleton Central Illinois Chapter National BDPA Technology Conference 2006 Los-Angeles, CA.
PART I: overview material
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
L-Systems Lindenmayer Systems Prusinkiewicz and Lindenmayer
Summer School „Modelling and Simulation with GroIMP“ / Tutorial for beginners University of Göttingen (Germany), September, 2010 Winfried Kurth Some.
Lindenmayer systems Martijn van den Heuvel May 26th, May 26th, 2011.
Fractals Douglas reeves.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
Chapter 34 Lecture Seven: Images: I HW 3 (problems): 34.40, 34.43, 34.68, 35.2, 35.9, 35.16, 35.26, 35.40, Due Friday, Sept. 25.
1 10/27/ :26 UML Simplicity in Complexity. 2 10/27/ :26 UML Rewriting Systems Classic Example: Koch 1905 Initiator Generator.
Fractals smooth surfaces and regular shapes - Euclidean-geometry methods -object shapes were described with equations natural objects - have irregular.
Chapter 36 Image Formation.
Copyright © Curt Hill Visualization of 3D Worlds How are these images described?
Procedural Modelling of Plant Scenes Presented by: Kim R 2 Supervisors:Shaun Bangay Adele Lobb A research project for Computer Science Honours 2004.
WORKSHOP “Fractal patterns…” Morahalom, May, 2009 Fractal patterns in geology, and their application in mathematical modelling of reservoir properties.
LINDFERN Lindenmayer Systems in VPython Nick Langhammer.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
The Interpreter Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Functional-Structural Plant Modelling with GroIMP and XL Tutorial and Workshop at Agrocampus Ouest, Angers, 5-7 May, 2015 Winfried Kurth University of.
Descriptive Geometry. Introduction  What is Descriptive Geometry? →It is the study of points, lines, and planes in space to determine their locations.
Basics Reflection Mirrors Plane mirrors Spherical mirrors Concave mirrors Convex mirrors Refraction Lenses Concave lenses Convex lenses.
1 What did we learn before?. 2 line and segment generation.
Main characteristics of Vector graphics  Vector graphics provide an elegant way of constructing digital images (diagrams, technical illustration and.
Grammars, L-Systems Jim Whitehead UC Santa Cruz School of Engineering courses.soe.ucsc.edu/courses/cmps265/Spring14/01 23 Apr 2014.
Geometric Transformations
Context-Free Grammars: an overview
Chapter 19: Symmetry and Patterns Lesson Plan
Geometric Transformations
ATCM 3310 Procedural Animation
CHAPTER 2 Context-Free Languages
Trees and Colored Edge Detection
Teori Bahasa dan Automata Lecture 9: Contex-Free Grammars
Presentation transcript:

Simulating Trees with Fractals and L-Systems Eric M. Upchurch CS 579

Background - Fractals Fractals are recursive, self-similar structures Fractals are recursive, self-similar structures Infinitely detailed – zooming in reveals more detail Infinitely detailed – zooming in reveals more detail Similar, though not necessarily identical, at any level of magnification Similar, though not necessarily identical, at any level of magnification Generated using a variety of methods, such as IFS and L-Systems Generated using a variety of methods, such as IFS and L-Systems Many natural forms display fractal geometry (like trees!) Many natural forms display fractal geometry (like trees!)

Background – L-Systems Formal grammar developed by Aristid Lindenmayer as a theoretical framework for studying development of simple multicellular organisms Formal grammar developed by Aristid Lindenmayer as a theoretical framework for studying development of simple multicellular organisms Subsequently applied to investigate higher plants Subsequently applied to investigate higher plants Uses rewriting rules (productions) to grow a string or system Uses rewriting rules (productions) to grow a string or system Productions are applied in parallel (unlike Chomsky grammars) Productions are applied in parallel (unlike Chomsky grammars) This is motivated by biological considerations – this is how living organisms grow This is motivated by biological considerations – this is how living organisms grow

Simple L-System Strings built of letters a and b Each letter is associated with a rewriting/production rule: a  ab b  a Rewriting starts from an axiom, a starting string (b in this case) Each production is applied simultaneously in each step

L-Systems – Properties Can be context-free or context-sensitive Can be context-free or context-sensitive Different production rules for the same symbol based upon neighboring symbols Different production rules for the same symbol based upon neighboring symbols If run repeatedly and interpreted as images, can produce fractal geometry If run repeatedly and interpreted as images, can produce fractal geometry Can describe many “traditional” fractal patterns, such as Koch curves and constructions Can describe many “traditional” fractal patterns, such as Koch curves and constructions Can describe & produce very complex fractal patterns Can describe & produce very complex fractal patterns

Iterated Function Systems An IFS is any system which recursively iterates a function or a collection of arbitrary functions on some base object An IFS is any system which recursively iterates a function or a collection of arbitrary functions on some base object An IFS can be used to generate a fractal pattern An IFS can be used to generate a fractal pattern The IFS fractal is made up of the union of several copies of itself, each copy being transformed by a function The IFS fractal is made up of the union of several copies of itself, each copy being transformed by a function No restriction on transformations, though they are usually affine No restriction on transformations, though they are usually affine Can use deterministic or stochastic processes Can use deterministic or stochastic processes

Iterated Function Systems If the system is made up by k functions (or transformations) {f i (x) | 1 < i < k} and iterated n times on the base set b, then the IFS is defined as the set: If the system is made up by k functions (or transformations) {f i (x) | 1 < i < k} and iterated n times on the base set b, then the IFS is defined as the set: { f i1 (f i2 (.. f ik (b).. )) | for all i j, with 1 < i j < k, j = (1, 2,.., k) } { f i1 (f i2 (.. f ik (b).. )) | for all i j, with 1 < i j < k, j = (1, 2,.., k) } In the limit that n becomes infinite, an IFS becomes a fractal. In the limit that n becomes infinite, an IFS becomes a fractal.

Relationship of IFS to L-Systems Both are recursive in nature Both are recursive in nature Both can be used to produce fractals Both can be used to produce fractals L-Systems are, arguably, a specialized form of IFS, whose functions are specified by the production rules of the grammar L-Systems are, arguably, a specialized form of IFS, whose functions are specified by the production rules of the grammar Replace the formal grammar of an L-System with functions/transformations, and you have an IFS Replace the formal grammar of an L-System with functions/transformations, and you have an IFS

Describing Trees A rooted tree has edges that are directed and labeled A rooted tree has edges that are directed and labeled Edge sequences form paths from a distinguished node, called the root or base, to terminal nodes Edge sequences form paths from a distinguished node, called the root or base, to terminal nodes In biological sense, these edges are branch segments In biological sense, these edges are branch segments A segment followed by at least one more segment in some path is called an internode A terminal segment (with no succeeding edges) is called an apex

Axial Trees Special type of rooted tree Special type of rooted tree At each node, at most one outgoing straight segment is distinguished All remaining edges are called lateral or side segments. A sequence of segments is called an axis if: the first segment in the sequence originates at the root of the tree or as a lateral segment at some node each subsequent segment is a straight segment the last segment is not followed by any straight segment in the tree. Together with all its descendants, an axis constitutes a branch. A branch is itself an axial (sub)tree.

Axial Trees Axes and branches are ordered The root axis (trunk) has order zero. Axis originating as a lateral segment of an n-order parent axis has order n+1. The order of a branch is equal to the order of its lowest-order or main axis

Example Axial Tree

Honda’s Model Limited model with following assumptions: Limited model with following assumptions: Tree segments are straight and their girth is not considered A mother segment produces two daughter segments through one branching process Lengths of the two daughter segments are shortened by constant ratios, r 1 and r 2, with respect to the mother segment Mother and daughter segments are contained in the same branch plane. The daughter segments form constant branching angles, a 1 and a 2, with respect to the mother branch Branch plane is fixed with respect to the direction of gravity so as to be closest to a horizontal plane. An exception is made for branches attached to the main trunk, where a constant divergence angle α between consecutively issued lateral segments is maintained

Honda’s Geometry

Honda’s Trees

My Tree Simulator Written in C++, using the DirectDraw API Written in C++, using the DirectDraw API Draws 2D trees by writing to a bitmap Draws 2D trees by writing to a bitmap Does simple lighting and shading Does simple lighting and shading Produces a fair mix of completely ugly trees and good looking/accurate trees Produces a fair mix of completely ugly trees and good looking/accurate trees Uses stochastic IFS transformations, inspired from L-Systems and extends Honda’s work Uses stochastic IFS transformations, inspired from L-Systems and extends Honda’s work Drawing infrastructure borrowed from a Julia Set generator Drawing infrastructure borrowed from a Julia Set generator

My Tree Simulator A tree is specified by: A tree is specified by: Radius (thickness of trunk) Radius (thickness of trunk) Height Height Some number of branches, each having: Some number of branches, each having: Scaling factor (all branches are scaled according to order) Scaling factor (all branches are scaled according to order) Height/length of branch Height/length of branch Lean angle (from higher order branch) Lean angle (from higher order branch) Rotation angle (around higher order branch) Rotation angle (around higher order branch) Number of branches is used in recursively creating branches Number of branches is used in recursively creating branches

My Tree Simulator IFS is performed by transformations specified in each branch. IFS is performed by transformations specified in each branch. Transformations: scale, lean, rotation, are stochastically determined Transformations: scale, lean, rotation, are stochastically determined Foliage is done using the same method but using different colors to give the illusion of leaves Foliage is done using the same method but using different colors to give the illusion of leaves Z-buffer utilized for determining which pixels are drawn Z-buffer utilized for determining which pixels are drawn

My Tree Simulator A tree contains several flags that define which IFS transformations are applied: A tree contains several flags that define which IFS transformations are applied: Use Branch Heights  If true, places branches randomly up trunk. If false, places all branches coming out of trunk (and recursive branches) at same point. Use Branch Heights  If true, places branches randomly up trunk. If false, places all branches coming out of trunk (and recursive branches) at same point. False tends to make trees more irregular. False tends to make trees more irregular. Global Scaling  If true, scales branches and foliage based on a single scale (stored in the trunk branch). Otherwise, scales each branch separately based on a scale stored per branch. Global Scaling  If true, scales branches and foliage based on a single scale (stored in the trunk branch). Otherwise, scales each branch separately based on a scale stored per branch. True makes trees more regular, and “tighter”. True makes trees more regular, and “tighter”. False makes trees more irregular, but can cause “puffiness” False makes trees more irregular, but can cause “puffiness”

My Tree Simulator Scale By Height  If true, branches and foliage decrease (more dramatically) as their height increases. Scale By Height  If true, branches and foliage decrease (more dramatically) as their height increases. True keeps some trees from getting too “puffy”. True keeps some trees from getting too “puffy”. False makes trees more top-heavy, fuller, like elms. False makes trees more top-heavy, fuller, like elms. True makes trees slimmer and decreasing, like a willow bush. True makes trees slimmer and decreasing, like a willow bush. True will give a younger looking tree, false will give an older looking tree with the same structure. True will give a younger looking tree, false will give an older looking tree with the same structure.

Future Work Convert to 3D Convert to 3D 2D representation is easier, but very limiting 2D representation is easier, but very limiting Allow model exportation for placement into virtual worlds Allow model exportation for placement into virtual worlds Use foliage models in 3D Use foliage models in 3D More realistic effect, scales well, could provide physics-based modeling effects (wind, sway, etc) More realistic effect, scales well, could provide physics-based modeling effects (wind, sway, etc) Enhance parameterization of trees Enhance parameterization of trees Currently, everything is random! Currently, everything is random!