growing vines and flowers


Programming is so interesting because even after over 20 years I mis-estimate the complexity of certain tasks.  Some things that seem simple can suck up hours and things that seem intimidating can occasionally end up being 3 lines (of albeit complex but doable) code.

I have been muddling through growing vines (confession, I consciously decided not to look for any reference material, because I wanted to try out some ideas on my own -- if you know of a perfect reference, feel free to email me, I just might ignore it until I am 100% happy with my own muddling).

I knew that I wanted a system that would allow vines to toggle between various types of 'growing' behavior and that ultimately the system offered interesting design decisions about where to put data (between vine state and growth function state).  Even knowing this, I started out with a naive solution in mind that I wanted to try, thinking to myself, 'I'll redesign it better after one iteration'.  Now 3 iterations in (there were bumps),  I am still thinking I'll do a nice prettier programmatic design next time... (Aaron, you always write it right first, don't you?).

(On a fun side note, Win and I have started to talk about trig and there are so many sines and cosines in this it was fun to share that).


still image of vine growth
using only one type of growth pattern
image of vine growth with alternating growth pattern

another with more tendrils video of the rough draft vines








Corresponding animation control and parameterization across differing growth patterns turned out to be a pain even when only toggling between two growth patterns (sin waves and spiraling). So the current state is just a `rough draft' but it represents the beginnings of something like what I want. But there are other exciting things I want to do before I circle back to tuning this for more organic looking growth and branching (and refactoring my ugly all in one mega class).

And in the meantime, at a moment when I didn't want to think about annoying parameterization, I implemented flowers since Max (thanks Max) sent me an interesting link (https://www.benfrederickson.com/flowers-from-simplex-noise/).  I made two different types.  One using simplex noise per the original reference (using Stefan Gustavson's Java implementation, edited to work within Processing) and one using the built in Perlin noise implementation in Processing.  The built in Perlin noise is symmetric so caused overly regular flowers, but by rotating each layer a small amount they look pretty good.

Flower using Perlin noise Flower using Perlin noise with small rotations between layers
Perlin and simplex noise flowers more flowers





Comments

  1. This comment has been removed by the author.

    ReplyDelete
  2. Never right the first time, of course. :P Lots of write, delete, write, refactor.

    ReplyDelete

Post a Comment

Popular posts from this blog

NZ Ferns - sampling parametric curves and recursion

I seriously know better but I do it too...