Hello so I am trying to wrap my mind around making a really simple but also powerful hotbox for my experimental kinect installation. What I have is a working kinect skeleton and I want lines to grow when a right hand is over them ( thus using only x and z values). The easiest and most intuitive way I went about this is to create a box around the line and when my hand is inside the box the line grows. The problem is how lines are randomly scattered in positive and negative values this is what I've tried so far
boolean check(PVector point) { //point is the passed value of a hand
boolean result = false;
println(point.x);
println(dot2.x); //dot2 is the second point that defines the line
if (point.x > dot2.x - center.y/2 && point.x < dot2.x + dot2.y/2) {
if (point.z > center.z - center.z/2 && point.z < center.z + center.z/2) {
dot2.y ++;
result = true;
println("gothit");
}
}
return result;
}
boolean check2(PVector point) {
boolean result = false;
println(point.x);
println(dot2.x);
if (point.x < dot2.x - center.y/2 && point.x > dot2.x + dot2.y/2) {
if (point.z < center.z - center.z/2 && point.z > center.z + center.z/2) {
dot2.y ++;
result = true;
println("gothit");
}
}
Aucun commentaire:
Enregistrer un commentaire