join two processing programs together
in
Programming Questions
•
11 months ago
I am working on catching up for my midterm but I am not finding what I want to do in the book.
Could someone help me put these two programs together?
what I want is to start with circle_expanding then have the draw_random_circles program draw for a while until a pattern is discerned or until a high fameCount is reached.
Then I want the expanding circles to start again and the whole thing to keep repeating
The part I am least sure about is how to define this value and how to join the programs together.
Thanks big time
circle_expanding:
float circleX = width/2;
float circleY = height/2;
float circleSize=0;
void setup() {
size(950,720);
frameRate=3;
}
void draw() {
background(255);
stroke(0);
fill(175);
ellipse(circleX,circleY,circleSize,circleSize);
circleSize=circleSize+1;
//for (int circleSize<height;circleSize>height){
noStroke();
// if circleSize+=1){
stroke(239);
}
--------------------------------------------------------------------------
------- --------------- ----------------- draw_random_circles:
void setup(){
background(0);
size(600,700);
noStroke();
smooth();
frameRate(2);
}
void draw(){
ellipse(random(0,width), random(0,height), random(0,width/4),random(0,height/4));
}
color randomColor(int rMax, int gMax, int bMax, int aMax){
int r = int(random(rMax));
int g = int(random(gMax));
int b = int(random(bMax));
int a = int(random(aMax));
return color(r,g,b,a);
}
color randomColor(int rMax, int gMax, int bMax){
int r = int(random(rMax));
int g = int(random(gMax));
int b = int(random(bMax));
return color(r,g,b);
}
Could someone help me put these two programs together?
what I want is to start with circle_expanding then have the draw_random_circles program draw for a while until a pattern is discerned or until a high fameCount is reached.
Then I want the expanding circles to start again and the whole thing to keep repeating
The part I am least sure about is how to define this value and how to join the programs together.
Thanks big time
circle_expanding:
float circleX = width/2;
float circleY = height/2;
float circleSize=0;
void setup() {
size(950,720);
frameRate=3;
}
void draw() {
background(255);
stroke(0);
fill(175);
ellipse(circleX,circleY,circleSize,circleSize);
circleSize=circleSize+1;
//for (int circleSize<height;circleSize>height){
noStroke();
// if circleSize+=1){
stroke(239);
}
--------------------------------------------------------------------------
------- --------------- ----------------- draw_random_circles:
void setup(){
background(0);
size(600,700);
noStroke();
smooth();
frameRate(2);
}
void draw(){
ellipse(random(0,width), random(0,height), random(0,width/4),random(0,height/4));
}
color randomColor(int rMax, int gMax, int bMax, int aMax){
int r = int(random(rMax));
int g = int(random(gMax));
int b = int(random(bMax));
int a = int(random(aMax));
return color(r,g,b,a);
}
color randomColor(int rMax, int gMax, int bMax){
int r = int(random(rMax));
int g = int(random(gMax));
int b = int(random(bMax));
return color(r,g,b);
}
1