Introduction to L Systems: Generating Procedural Plants
ฝัง
- เผยแพร่เมื่อ 4 มิ.ย. 2024
- L Systems are a great way of generating all sorts of complex and organic looking structures with code, perfect for generative art and procedural generation. In this video we take a look at the basics of the L System and how we can use it to generate a tree!
If you have any questions be sure to ask in the comments down below :)
Here is the Wikipedia article for L-Systems:
en.wikipedia.org/wiki/L-system
If you want to code along you can use the P5js online editor:
editor.p5js.org/
Find the code for this video here:
editor.p5js.org/BarneyCodes/s...
Follow me:
Support the channel: www.youtube.com/@BarneyCodes/...
Twitter: / barneycodes
Reddit: / barneycodes
0:00 Intro
0:42 Defining the rules
2:48 Next generation
5:19 Defining the drawing rules
9:35 Visualisation
13:50 Adding colour
16:32 Final product
#creativecoding #p5js #javascript
Be sure to check out my other P5js videos: th-cam.com/play/PLlaA0JvEhcG8kb6x-Cc3RM5JMjq4ribQ5.html
What would you like to see me do in the next video?
concise, simple and fun implementation , I am obsessed with these L-Systems recently, this video was a great help to me.
That's great to hear! They can be a lot of fun to play around with! If you haven't already, you should try making them randomised, it makes them even more fun!
Very concise and clear explanation! Can't wait to try this out!
Glad you enjoyed it! I've got a few other videos on L Systems that might interest you. I'd love to see what you come up with, so feel free to share either on my discord or on twitter!
Amazing video, i often find myself travelling down programming rabbit holes and this video was very useful. Keep up the great work!
Thank you so much, glad you enjoyed the video!
with that code you only need to change the rules and drawRules to generate differents l-systems, very optimal, nice video :D
Thanks! Glad you liked it!
Excellent video. Thanks, Barney!
Thanks Steve, very kind of you!
I was looking for L system. Finally found one. Thank you so much. Would love to see more on L system using p5.js
Glad you enjoyed it! I'm planning to do another video on it soon that includes randomising the growth 👍 Is there anything in particular you'd like to see?
@@BarneyCodes Randomizing would be a good one. I was thinking if you could make a playlist on L system and create tutorials on various kinds of trees/forest/combination using p5.js. I've noticed tree/nature based tutorials using p5.js and L system are not much yet on YT. It might create a good value.
@@BarneyCodes Also I would love to see varying stroke width for tree's lower portion and upper portion. Usually upper portion that are attached to leaves has less width. mousePress is a nice way to understand it. Also, it would be great to see controlling tree length, width using code, without using mousePress, just a little extra touch would be nicer. : )
Those are some great ideas, I'll note them down! Cheers
Oh, btw, the suggestion added > not necessarily be on L system, could be on other algorithms as long as it's based on tree/nature.
Thanks bro, this is useful. I love plants ❤️
No worries, glad you found it useful!
very useful, amazing video! but I have a question, could you make more videos on processing? thanks :)
I'm glad you enjoyed the video! Part of the reason I changed to using P5js is that it's a much simpler process for me to share the code I write in these videos as the P5 editor has that built in. But I'll keep processing in mind for future videos, some things are better suited for it!
Good video
Cheers mate
yall how do i draw weed in it