Animating Procedural Plant Growth (L System Lerp)

Sdílet
Vložit
  • čas přidán 5. 08. 2024
  • Code from video: editor.p5js.org/BarneyCodes/s...
    Other L System rules to try: paulbourke.net/fractals/lsys/
    Wiki article on L Systems: en.wikipedia.org/wiki/L-system
    L Systems are really great for easily generating plants, but it's always bugged me how much the plant changes between generations. I want to watch my plants grow smoothly! So today we are going to fix that by linearly interpolating (lerping) between L System states.
    Follow me:
    Support the channel: www.youtube.com/@BarneyCodes/...
    Twitter: / barneycodes
    Reddit: / barneycodes
    Chapters:
    0:00 Intro
    1:03 L System refresher
    1:52 Linear interpolation (lerp)
    2:23 Updated draw rules
    3:19 Which characters to lerp?
    4:27 Updated L System rules
    5:19 Drawing lerped L Systems
    6:30 Quick recap
    6:43 Bringing it all together
    #creativecoding #p5js #javascript

Komentáře • 20

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

    If you'd like to see what else I'm working on, it would be great if you could wishlist my game Star Mining Co. on Steam! s.team/a/2584800/

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

    One of the best videos on practical applications of L systems for procedural plant generation on yt

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

      Thank you! I think L systems are awesome, but there really doesn't seem to be much out there beyond the basics. Definitely something I'd like to keep working on in the future!

  • @kinsukaweerasooriya2933
    @kinsukaweerasooriya2933 Před měsícem

    this is pure gold for me ❤

  • @lucasdevecchi8008
    @lucasdevecchi8008 Před rokem +1

    Nice edition and well explained, keep it up!

  • @ProgramSam
    @ProgramSam Před rokem +5

    Looks neat! Now all that is left if a little decay animation and you can create an infinite forest animation 😄

    • @BarneyCodes
      @BarneyCodes  Před rokem +4

      Thanks! And that would be really cool, I think that would probably mostly be done just in the rules of the L System!

  • @abdulazeem552
    @abdulazeem552 Před rokem +1

    Very nicely explained. Thank you.

  • @berkipekoglu
    @berkipekoglu Před rokem +1

    You're awesome! Please more videos :)

  • @david3710
    @david3710 Před rokem +2

    Very cool!

  • @raddek.i
    @raddek.i Před rokem +1

    Amazing!

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

    Hey thank you so much for this video!! I really wanted to modellate the fractal growth of an existing tree. do you have an idea how to approach this? I would measure the branches and the angles of them but I don't know what to do with the data

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

      I've tried doing this a few times and I'm not going to lie, I've found it pretty tricky. It's definitely possible though! I think the best way to approach it is to probably sketch out a version of the tree and try to identify the repeating/fractal structure of it, and then create the rules that lead to that shape. Sketching out the different stages of growth may also be helpful, then you can look at what's changed between the two generations, and this should help you to know how the rules should work.
      The wikipedia article on L Systems has a bunch of examples too which could be a helpful starting point for rules, which you could then tweak/modify to be more like your tree.
      One tip I have is to use characters that make sense to you. Most of the rules I've seen use "X", "F", "A", these sorts of things, but you might prefer to use something like "T" for trunk, "B" for branch, "L" for leaf, etc. It might just help to wrap your head around what's happening!

  • @bakdiabderrahmane8009
    @bakdiabderrahmane8009 Před 9 měsíci +1

    very helpful, it would like to see this in 3D.

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

      That's on my list to do! I think it would be really cool!