in ,

Show HN: Animating randomized L-Systems in real time, Hacker News

Click here to start the visualization

)

or click here or here or here (SEIZURE WARNING) for some more examples of what can be generated

How to use this site:

Clicking anywhere on the visualization will bring up a menu with a bunch of sliders you can use to change how the L-Systems are generated. Clicking off the menu will make it disppear. Using the menu you can control the following parameters:

Fade time

: The time it takes for a line to completely fade away

    Lines per frame

  • : The number of lines that are drawn every frame

    Growing an L-System

    An L-System is a string rewriting system that can generate fractal and tree like structures. They consist of a seed string and a set of rules to grow the seed into a more complex string . Each rule operates on a single character of the string, and replaces that character with another string. For example, consider the following seed and rules:

    Seed: “abc” Rules:     “a” -> “cc”,     “c” -> “ba”

       

    Applying these rules to the seed will yield the string "ccbba"

    . Now the same rules can be applied to this new string to grow the system even more: 

    “ccbba” (becomes “bababbcc”

      bababbcc ” (becomes  "bccbccbbbaba" 
      
    etc

    Visualizing an L-System . )

    L-Systems can be visualized in many different ways, but the most common method involves using a
    turtle

    . First, you come up with an L-System as well as an arbitrary angle, A , to associate the L-System with. Then, you grow your L-System string by applying rules to the seed numerous times. To draw the L-System using the turtle you interpret every character of the grown string as an instruction to the turtle. Most L-Systems visualizers (including this one) use the following character set:

      F: Move the turtle forward

        ” “: Turn the turtle A degrees clockwise – “: Turn the turtle A degrees counterclockwise

    “[“: Push the current position of the turtle onto a stack

  • “]”: Pop a position off the stack and move the turtle to that position
  • Any other characters can be ignored by the turtle.


    Read More

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

PoC remotely dump memory with no user interaction on iPhone 11 Pro (iOS 13.3), Hacker News

Facebook pulls Trump campaign ads for fake census claims, Ars Technica

Facebook pulls Trump campaign ads for fake census claims, Ars Technica