We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › wandering paths / worms / ribbons
Page Index Toggle Pages: 1
wandering paths / worms / ribbons (Read 1797 times)
wandering paths / worms / ribbons
Dec 23rd, 2009, 10:13pm
 
hey fellow processors,

I am really curious about the illustration that is posted as the backgound to, oddly enough, the Open Frameworks website...  I'm sure something similar is possible with Processing as well.

openframeworks.cc/new_site/wp-content/themes/ofw/backgrounds/1.jpg

So, what's the deal with shifting through colors as you draw?  Is is possible or even desirable to increment hex color values?  Or perhaps better to store color values in an array and increment that?

Also, what are some ideas for producing wandering type motion, like a moving worm or ribbon type thing such as the linked illustration?  Code hints are welcome, but really I am most interested in the maths behind it.  Any tips to point me in the right direction would be much appreciated.

Thanks!  Wink
Re: wandering paths / worms / ribbons
Reply #1 - Dec 24th, 2009, 1:42am
 
Well the Brownian motion example isn't a bad place to start on this.  Since each segment of the line is a separate short line you can apply different colours to it.  There are various approaches to changing colour: for instance it may be easier to switch colorMode() to HSB, set a random hue and increment the Brightness a few times before switching hue and repeating...  (Also search 'bitwise operators' for performing fast operations on individual channels of a colour).

The only thing I think I would have trouble figuring out initially is how to use curves instead of straight lines.  You can define a curve mathematically as a set of joined points or you can use Bezier curves; though in this case you'd probably want bezierVertex... but for that you have to calculate an extra point to define the curve and the trick would be to keep this within sensible limits...
Re: wandering paths / worms / ribbons
Reply #2 - Dec 27th, 2009, 2:18pm
 
thanks blindfish!

I also found the following resources....

This one's in Ruby, but I really like the results.... working on translating it to Processing now...
bagofsouls.com/entry/7/Wandering_Algorithms

Also, found this section from Schiffman's teaching section on steering behaviors, which seems to be useful:
shiffman.net/teaching/nature/steering/

Serious math heads please feel to chime in any time with your advanced graduate level knowledge  Grin
Re: wandering paths / worms / ribbons
Reply #3 - Jan 13th, 2010, 5:36pm
 
Ok, it looks like these two posts are similarly related, as a steering library would be a help for this problem...

Boids steering Library thread
processing.org/discourse/yabb2/num_1255052351.html


Also, someone mentioned a sine wave feeback algorithm could create interesting motion, although I'm not sure how to implement that specifically.
Re: wandering paths
Reply #4 - Jan 14th, 2010, 5:17pm
 
here is some more related stuff for anyone who's interested:


(the original) Boids stuff by Craig Reynolds
red3d.com/cwr/steer/

AS3 Wander motion class
gskinner.com/blog/archives/2009/11/wander_motion_c.html

Livebrush Project - Motion based drawing tool
livebrushproject.blogspot.com
livebrush.com
Re: wandering paths / worms / ribbons
Reply #5 - Jan 28th, 2010, 12:52pm
 
This is great!  I'm interested in code hints, rather than the math behind it. If anyone has ideas, I'd be most appreciative! Kiss
Page Index Toggle Pages: 1