Simulating Trees with Fractals and L-Systems - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Simulating Trees with Fractals and L-Systems

Description:

Simulating Trees with Fractals and L-Systems Eric M. Upchurch CS 579 Background - Fractals Fractals are recursive, self-similar structures Infinitely detailed ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 22
Provided by: csUccsEd6
Learn more at: http://www.cs.uccs.edu
Category:

less

Transcript and Presenter's Notes

Title: Simulating Trees with Fractals and L-Systems


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

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

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

4
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

5
L-Systems Properties
  • Can be context-free or context-sensitive
  • Different production rules for the same symbol
    based upon neighboring symbols
  • 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 produce very complex fractal
    patterns

6
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 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
  • No restriction on transformations, though they
    are usually affine
  • Can use deterministic or stochastic processes

7
Iterated Function Systems
  • If the system is made up by k functions (or
    transformations) fi(x) 1 lt i lt k and iterated
    n times on the base set b, then the IFS is
    defined as the set
  • fi1(fi2 ( .. fik(b) .. )) for all ij, with 1
    lt ij lt k, j (1, 2, .. , k)
  • In the limit that n becomes infinite, an IFS
    becomes a fractal.

8
Relationship of IFS to L-Systems
  • Both are recursive in nature
  • 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
  • Replace the formal grammar of an L-System with
    functions/transformations, and you have an IFS

9
Describing Trees
  • 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
  • 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

10
Axial Trees
  • 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.

11
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 n1.
  • The order of a branch is equal to the order of
    its lowest-order or main axis

12
Example Axial Tree
13
Hondas Model
  • 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, r1 and r2, with
    respect to the mother segment
  • Mother and daughter segments are contained in the
    same branch plane. The daughter segments form
    constant branching angles, a1 and a2, 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 a between consecutively
    issued lateral segments is maintained

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

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

18
My Tree Simulator
  • IFS is performed by transformations specified in
    each branch.
  • Transformations scale, lean, rotation, are
    stochastically determined
  • 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

19
My Tree Simulator
  • 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.
  • 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.
  • True makes trees more regular, and tighter.
  • False makes trees more irregular, but can cause
    puffiness

20
My Tree Simulator
  • Scale By Height ? If true, branches and foliage
    decrease (more dramatically) as their height
    increases.
  • True keeps some trees from getting too puffy.
  • False makes trees more top-heavy, fuller, like
    elms.
  • 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.

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