Infinite Patterns
Brief:
This sketch utilizes the concepts of fractals and L-systems to depict a little girl swinging, with her dress billowing in the wind.
Inspiration:
At first I just want to try L-systems myself after watching Daniel Shiffman’s tutorial. I actually have no idea what I can do. I used to think about feathers in wings, veins in human body, human alveoli… So many stuff! But I don’t think I can visualize them vividly.
I suddenly find a website. This website allows me to view my drawings of L-system in real time, all I need to do is just write the algorithm myself. Thus, I stopped obsessing about what I could do and I started exploring algorithms. And finally I think I can make dress based on them.
The amazing website here: https://kevs3d.co.uk/dev/lsystems/
Process:
I have to admit that this code heavily depends on Daniel Shiffman’s code in his coding challenge#6. especially the part how to “read” the algorithm to draw on screen.
So I first watch this video. For the algorithm part, I feel it is so interesting and begin to search for other L-system online.
image form here
So how such many F works? Basically, we need our computer to read through “[]”, “F”, “+”, and “-“. (I draw a very simple example as follows😋 (hope it is not wrong😇 (or misguide someone
After watching numerous videos, I finally found a website that allows for the online, real-time editing and viewing of L-systems.
I searched for the example code online.
However, I first failed to create a dropdown. What I create can only work at the beginning. If you change your selection, then the pattern won’t display anymore.
here is the example code he provides me.
So I changed mine…
Done!
Reference:
Daniel Shiffman coding challenge#16: https://www.youtube.com/watch?v=E1B4UoSQMFw
(↑very very important for my sketch!)
Deniel Shiffman coding challenge#15: https://www.youtube.com/watch?v=fcdNSZ9IzJM
some brief intro to L-system: https://w-o-s.ru/article/4003
https://www-archiv.fdm.uni-hamburg.de/b-online/e28_3/lsys.html
realtime L-system editor web: https://kevs3d.co.uk/dev/lsystems/
onChange() how to use: https://www.w3schools.com/jsref/event_onchange.asp
Object.keys() basic function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys