A stupid question: Make new ellipse when clicked
in
Programming Questions
•
1 years ago
Hi,
I've been looking for a very long time for this and i'm stuck too long to not ask a stupid question :)
I'm working with a Kinect and when my hand is 200 units in front of my torso I want it to draw a ellipse, but when I go back with my hand, I want the ellipse to still be there so that I can make a new ellipse when I do it again.
Kinda like when you click, and a ellipse pops up at that location, but when i click again another ellipse appears.
As you can see in the code, when I return my hand to my torso, the ellipse disappears.
void draw() {
.....
rechthoek();
.....
rechthoek();
....
}
}
void rechthoek(){
noStroke();
float relz = tz - lhz; // relative distance in z direction from left hand to torso
if(relz > 300){
ellipseMode(CORNERS);
fill(r,0,0);
ellipse(lhx,lhy,rhx,rhy);
r = r - 5;
if(r == 0){
r = 0;
}
}
}
noStroke();
float relz = tz - lhz; // relative distance in z direction from left hand to torso
if(relz > 300){
ellipseMode(CORNERS);
fill(r,0,0);
ellipse(lhx,lhy,rhx,rhy);
r = r - 5;
if(r == 0){
r = 0;
}
}
}
1