Hello,
I am very new in Processing. I am using Processing 3.3. So I found this formula and I want to move the animation by tracking my movements from a Kinect instead of a mouse. I am using the new Kinect on a Mac. I can get information from kinect2 but I can't find a way to connect my movements with the animation. Can pls someone help me?
void setup () {
size (500,500);
noFill();
stroke(255);
strokeWeight(2);
}
void draw() {
background(0);
translate(width /2, height/2);
beginShape();
// add some vertices
for (float theta = 0; theta <= 2 * PI; theta += 0.01) {
float rad = r(theta,
mouseX / 100.0, // a
mouseY / 100.0, // b
70, // m
1, // n1
2, // n2
2 // n3
);
float x = rad * cos (theta) * 50;
float y = rad * sin (theta) * 50;
vertex (x, y);
}
endShape();
}
float r(float theta, float a, float b, float m, float n1, float n2, float n3) {
return pow(pow (abs(cos(m * theta / 4.0)/a), n2 ) +
pow (abs(sin(m * theta / 4.0) /b), n3), -1.0 / n1) ;
}