Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for On Lindenmayer Systems
João Freitas
João Freitas

Posted on • Edited on • Originally published atjoaomagfreitas.link

     

On Lindenmayer Systems

Yesterday I learned about Lindenmayer Systems (L-System) throughGil Durão talk atFlutter Talk Porto 2023. It's a formal specification of a grammar primarly used to model bacteria, algae, plants and tree growth, as originally proposed byAristid Lindenmayer.

At its core there are three components (G=⟨V,ω,P⟩):

  • Analphabet, which is a list of symbols that can be combined to create strings (e.g.,ABC,+-*/), denoted asV.
  • Anaxiom, which defines the starting point of the L-System (e.g.,BC), denoted asω.
  • A set ofproduction rules, which determine how each symbol of the alphabet is transformed into other symbols (e.g.,A -> AB, B -> AC, C -> CB), denoted asP.

The goal behind these systems is to specifyfinite orinfinite strings, which are constructed iteratively by applying the production rules to the symbols from the previous iteration. Using the example above:

  • BC (Axiom - Iteration 0)
  • ACCB (Iteration 1)
  • ABCBCBAC (Iteration 2)
  • ...

Production rules specify the class/type of L-Systems, with the simplest one beingD0L-system (deterministic and context-free L-System), which are represented by functions that take symbols as input and deterministically map them to other symbols as output. You can learn more about different classes on thisarticle.


Okay, but what exactly can we use L-Systems for?

While many people use them to generate fractals (because fractals are cool), you can also use L-Systems to leverage yourprocedural generation game:

Gil prepared a demo of using L-Systems to generate fractals with Flutter. You can check it outhere. Also, hispresentation is free, so be sure to grab it!

gif of a l-system describing a growing plant

Top comments(2)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
tinygamedev profile image
Tiny
making games and writing about it
  • Location
    California
  • Joined

Nice intro post, L-systems are great! This is also the first time I realize Flutter might be a great framework for making games. Any chance you know if the talk you mention is available online somewhere? Your link sends me to a meetup login page.

CollapseExpand
 
freitzzz profile image
João Freitas
Crafter, in love with making new products
  • Location
    Porto
  • Joined

The L-System talk is available on Gil GitHub repo:github.com/gildurao/flutter-lsyste...

The other talk was lectured by Renan and it's about Flutter on Android Smartwatches:github.com/renancaraujo/slides/blo...

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Crafter, in love with making new products
  • Location
    Porto
  • Joined

More fromJoão Freitas

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp