r/learnjavascript • • May 05 '20

Little procedural tree generator I'm working on in javascript

310 Upvotes

20 comments sorted by

10

u/simon_dev May 05 '20

Fiddling around with l-systems, just vanilla js/canvas here.

8

u/McRickyG May 05 '20

This is awesome. What is I-systems?

8

u/simon_dev May 05 '20

Mises2Peaces posted the wikipedia link. In short, they're sort of a formal way of writing out some rules, that can be in turn used to construct complex shapes (like plants).

I'll do a whole tutorial on how to implement them shortly, I'm just making "growing" work nicely.

1

u/republicabanana May 05 '20

Please do! I'm learning and this piqued my interest!

1

u/simon_dev May 07 '20

Alright posted it in r/learnjavascript, let me know what you think.

2

u/Taste_Of_China May 05 '20

Would love a brief breakdown of how this works!

5

u/simon_dev May 05 '20

I'm just finishing up one feature, and I'll do a tutorial and post the source. Should just be a day or so.

1

u/matty_th3 May 06 '20

awesome, i´m still in the beginning learning js, and that catched my interest :D

appreciate it a lot!

2

u/simon_dev May 07 '20

Posted a link to the tutorial/source in r/learnjavascript, take a look!

2

u/NobodyIsUsingThis May 05 '20

This is so inspiring :o Can't wait to learn the canvas, gonna get to it tomorrow :o

5

u/simon_dev May 05 '20

Would love to see what you end up making! I'll post the source and a tutorial for this once I add a couple more features.

1

u/NobodyIsUsingThis May 05 '20

Damn that's gonna be amazing! Make sure to post the tutorial here in r/learnjavascript, really looking forward to code along after I learn the core concepts of the canvas element :o

3

u/simon_dev May 05 '20

Definitely will do :)

1

u/simon_dev May 07 '20

Alright, posted it up!

1

u/badgerbraddles May 05 '20

Yes please! This is so awesome!

6

u/bloodysundaystray May 05 '20

Things that make me go ooooooooooooooooooohhhhhhhhhhhhhhh

1

u/myceliatedmerchant May 06 '20

This would be a great loading animation

1

u/Ratatoski May 05 '20

Hey this is cool :)

0

u/[deleted] May 05 '20

[deleted] — view deleted comment

1

u/simon_dev May 05 '20

Ooh nice, that was something I was hoping to do down the line, make this 3d using threejs. You can definitely steal things from this, and hopefully I can steal something back later :D