We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm wondering what the process is behind creating 'waves' of things.
The fades / arc changes happen one after another in a spiral, but I'm not too sure how to go about making that happen, unless it was a massive chain of if conditions?
I had a little attempt at creating flat colors with the previous logic but it didn't really work out, here's an image of that and here's the code:
void setup() {
size(500, 500);
noStroke();
}
int num = 8;
float radius = 100;
float t;
int frames = 500;
void draw() {
t = (frameCount%frames)/(float)frames;
background(0);
translate(width/2, height/2);
for (int i=0; i < num; i++) {
float r = map(i, 0, num, 0, TWO_PI);
if ((r > PI) && (r < TWO_PI)) {
fill(255, 100, 100);
} else {
fill(20, 255, 255);
}
rotate(r);
ellipse(radius, 0, 50, 50);
}
}
Or say that I had a grid of squares and wanted to make them grow in a 'wave' across the screen, I'm not how one would go about this. Or change color or whatever.
If I do something like
fill(255, 255, mouseX);
That will make it so the colour is gradually changing from white to yellow, but (a) it doesn't do it only at the mouse location (b) I don't really want these kinds of effects to be dependent on mouse moving.
Here are a couple more examples of 'things happening in waves' (not sure the correct term for this)
thanks
EDIT :
I thought that I'd add another example, this time from myself that might help convey where I'm at with this and maybe more light on what I'm talking about.
in this code the color is set to change each quarter, a quarter being represented by frameCount%frames == 0
. It's not done across the board so it's patchy, but you get the idea.
Currently this changes the color of all of the shapes each time that frameCount % frames == 0
is true. But what if instead of them ALL changing like a light switch the intention was that they changed one after another in a sequence, or that the change happened incrementally across each one in a continuous flow around the circle. Or that the ebb and flow of the shapes themselves occurred one after the other, rather than the sync that they're currently in. I've no idea what tools or methods are required for this kind of process. Thanks :)
Comments
not sure if we bump things here or just let them die...
no, bump them!
more so since we can't easily jump back to the old pages in the forum as it used to be....
;-)
CLEAR threads alive!
Cheers @Chrisir, I guess this post was more a question of the logic behind creating these kinds of effects and techniques, if anyone has any info that's ace. Sos if it's a bit vague, I don't really know what I'm talking about ;)
I guess it mostly has to do with math.
you set up a value e.g. an expanding and deflating cirlce as in my sketch below.
or an rotating angle like in one of your examples.
Then you take this invisible (no entity on the screen uses it directly) value and let the swarm / Particles / colors react to it. Using dist() e.g.
;-)
ace cheers Chrisir I'll go through what you've done now, was just making an edit to the OP when you posted
see
http://forum.processing.org/two/discussion/7860/spiral-flow-field/p1
cheers Chrisir - going to take me a bit to go through the first example you gave, I'll no doubt have a few questions on that :)
here is an example
all circles do the same, but they are in a different phase / stage of doing that (because the 1st circle started at 0, the second at 12, the 3rd at 24 etc.)
the human eye sees that as a wave
[EDITED]