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 › Wave Patterns
Page Index Toggle Pages: 1
Wave Patterns (Read 993 times)
Wave Patterns
Sep 26th, 2007, 9:44pm
 
I would like start making a sketch something like
http://vimeo.com/207042

Does anyone have a good idea of what I should start with?
I have been working a lot with particles' behavior with vector class but I am now really stucked with how I can represent this kind of wave pattern that changes in time. I would appreciate if someone can give me any tips to get to it.

Thank you very much,
c.

Re: Wave Patterns
Reply #1 - Sep 28th, 2007, 9:39pm
 
I'm not sure what exact functions were used to generate those forms.  But it looks like interference patterns.  You need to fill each pixel in the window with a color.  The color is a function of time and position.

Example:
Code:

color col;
float a,b,c;
float time; //changes with each frame

void setup(){
size(320,240,P3D);
colorMode(RGB,1,1,1,1);
loadPixels();
}



void draw(){
time+=.1; //step ahead in time with each frame

//Now go through each pixel in the window:

for(int x=0;x<width;x++){
for(int y=0;y<height;y++){

//create values with trig functions, noise, etc acting on X,Y and time.
//Experiment with how these values are modulating over time.

a=dist(x,y,width/2,height/2);
b=abs(cos(x/10.+time));
c=noise(y/120.*cos(time/10.));

col=color(abs(cos(a/20.+b+c*90.)));
//combine values into a color somehow. Again the possibilities are limitless



set(x,y,col);

}
}

updatePixels();
}


I know thats not exactly what the video looked like but it should help get the point across of the mechanics of how such a thing is made.
Re: Wave Patterns
Reply #2 - Sep 30th, 2007, 5:51pm
 
To Movax,
thank you for your reply! I never made this type of pattern so I really appreciate you gave me a very good example to start.

But I am still wondering how you can create the different scales of pattern in time like zooming-in and -out shown in that vimeo thing.(I am even not sure if I can call it as zooming in or out since I am a math-illiterate)

other (visual) references_some .gif images
http://forum.physorg.com/index.php?showtopic=8100&st=135&#entry113427
or
http://forum.physorg.com/index.php?showtopic=5139

Do you think each pixel or points have to have some sort of interaction or attraction? or there is only one type of field to coordinate this type of change....?

I hope what I wrote makes sense...
Thank you again,
c.
Re: Wave Patterns
Reply #3 - Oct 1st, 2007, 11:43am
 
ha, spent some time trying this as well, superpositioning two different sine waves, horizontal and vertical. looked nothing like your example though.

then i went further and made each colour channel a different wave and varied the wavelengths over time. and then added diagonal and concentric waves too. turned out nice, i think.

example result and link to applet here:
http://www.flickr.com/photos/31962137@N00/1466591069/

BUT i think the example you linked to is more of a "reaction diffusion" thing. there's a nice applet over on Texture Garden that i found the other day whilst looking for procedural textures: http://texturegarden.com/java/rd/index.html

(edited for spelling)
Re: Wave Patterns
Reply #4 - Oct 2nd, 2007, 7:31am
 
Thank you for your replay, koogs.
It is nice that I could see some sorts of multiple dimensions of pattern by superimposing of concentric wave and another. I will look at your pattern to see how it works and also try to contact the guy who made the texture garden to see if he can give me a tip of the function of the reaction-diffusion system.
Thank you very much for your help. I really appreciate this.

c.
Page Index Toggle Pages: 1