Introduction to L Systems: Generating Procedural Plants

Sdílet
Vložit
  • čas přidán 31. 05. 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

Komentáře • 25

  • @BarneyCodes
    @BarneyCodes  Před rokem +1

    Be sure to check out my other P5js videos: czcams.com/play/PLlaA0JvEhcG8kb6x-Cc3RM5JMjq4ribQ5.html
    What would you like to see me do in the next video?

  • @bakdiabderrahmane8009
    @bakdiabderrahmane8009 Před 7 měsíci +3

    concise, simple and fun implementation , I am obsessed with these L-Systems recently, this video was a great help to me.

    • @BarneyCodes
      @BarneyCodes  Před 7 měsíci +2

      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!

  • @SuperMaramau
    @SuperMaramau Před 3 měsíci +3

    Very concise and clear explanation! Can't wait to try this out!

    • @BarneyCodes
      @BarneyCodes  Před 3 měsíci

      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!

  • @Fybir_
    @Fybir_ Před rokem +4

    Amazing video, i often find myself travelling down programming rabbit holes and this video was very useful. Keep up the great work!

    • @BarneyCodes
      @BarneyCodes  Před rokem +2

      Thank you so much, glad you enjoyed the video!

  • @juliobedoya7165
    @juliobedoya7165 Před 8 měsíci +2

    with that code you only need to change the rules and drawRules to generate differents l-systems, very optimal, nice video :D

  • @StevesMakerspace
    @StevesMakerspace Před rokem +1

    Excellent video. Thanks, Barney!

  • @Nothing-cx4jt
    @Nothing-cx4jt Před rokem +1

    I was looking for L system. Finally found one. Thank you so much. Would love to see more on L system using p5.js

    • @BarneyCodes
      @BarneyCodes  Před rokem +1

      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?

    • @Nothing-cx4jt
      @Nothing-cx4jt Před rokem +1

      @@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.

    • @Nothing-cx4jt
      @Nothing-cx4jt Před rokem +1

      @@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. : )

    • @BarneyCodes
      @BarneyCodes  Před rokem +1

      Those are some great ideas, I'll note them down! Cheers

    • @Nothing-cx4jt
      @Nothing-cx4jt Před rokem +1

      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.

  • @animanoir
    @animanoir Před 2 lety +2

    Thanks bro, this is useful. I love plants ❤️

    • @BarneyCodes
      @BarneyCodes  Před 2 lety +2

      No worries, glad you found it useful!

  • @mrboblox4444
    @mrboblox4444 Před 2 lety +2

    very useful, amazing video! but I have a question, could you make more videos on processing? thanks :)

    • @BarneyCodes
      @BarneyCodes  Před 2 lety +2

      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!

  • @ramithsamayamanthree3106
    @ramithsamayamanthree3106 Před 2 lety +1

    Good video

  • @macdonald715
    @macdonald715 Před 5 měsíci

    yall how do i draw weed in it