bubbles should fly from one point of the one side to different dirctions towars the other side!
in
Programming Questions
•
2 years ago
Hi,
I am pretty new in processing.
I build a propeller to a mouse scroll wheel axis and want to let projected (Beamer from ceiling to ground) bubbles fly out of the propeller if I blow it. Like Soapbubbles.
But I do not really get further at this point.
The Propeller stands at the middle of the left side of the screen and should blow the bubbles to the right side.
The Speed in x should get smaller the further the bubbles come. the different speed in y (left or right) should stay similar, as if the wind blows them away.
Inside of the ellipses (bubbles) should bright smaller ellipses underline the look of reflections of bubbles.
I hope you can give me advices, how I can find my way.
Thanks! Iza
Here my scetch:
blasenmenge[] blasen = new blasenmenge[100];
void setup(){
size(1000, 500);
for (int i=0; i<blasen.length; i++) {
blasen[i] =new blasenmenge();
}
}
void draw(){
background(0);
for (int i=0; i<blasen.length; i++){
blasen[i].schweben();
blasen[i].form();
}
}
////////////////////////////////////////////////////////
//////////////Class////////////////////////////////////
class blasenmenge{
float x; // hotizontale position
float y; // vertikale position
float speed;
float opacity;
//float platzen
blasenmenge(){ //Anfang
x=0;
y=height/2;
speed=random(0,10);
}
void form(){
pushMatrix();
opacity= random (30,100);
fill(255,opacity);
stroke(random(10,40));
ellipse(x,y,100,100);
popMatrix();
}
void schweben(){
x=x+speed;
if(x > 0){
x= x;
y= y+random(-15,15);
}
}
}
I am pretty new in processing.
I build a propeller to a mouse scroll wheel axis and want to let projected (Beamer from ceiling to ground) bubbles fly out of the propeller if I blow it. Like Soapbubbles.
But I do not really get further at this point.
The Propeller stands at the middle of the left side of the screen and should blow the bubbles to the right side.
The Speed in x should get smaller the further the bubbles come. the different speed in y (left or right) should stay similar, as if the wind blows them away.
Inside of the ellipses (bubbles) should bright smaller ellipses underline the look of reflections of bubbles.
I hope you can give me advices, how I can find my way.
Thanks! Iza
Here my scetch:
blasenmenge[] blasen = new blasenmenge[100];
void setup(){
size(1000, 500);
for (int i=0; i<blasen.length; i++) {
blasen[i] =new blasenmenge();
}
}
void draw(){
background(0);
for (int i=0; i<blasen.length; i++){
blasen[i].schweben();
blasen[i].form();
}
}
////////////////////////////////////////////////////////
//////////////Class////////////////////////////////////
class blasenmenge{
float x; // hotizontale position
float y; // vertikale position
float speed;
float opacity;
//float platzen
blasenmenge(){ //Anfang
x=0;
y=height/2;
speed=random(0,10);
}
void form(){
pushMatrix();
opacity= random (30,100);
fill(255,opacity);
stroke(random(10,40));
ellipse(x,y,100,100);
popMatrix();
}
void schweben(){
x=x+speed;
if(x > 0){
x= x;
y= y+random(-15,15);
}
}
}
1