ReaTIVision question...angle
in
Contributed Library Questions
•
1 year ago
Hi guys,
I have a problem.
I can't create an action changing the angle of the fiducial.
Better, when I rotate the fiducial n.0, I want that will start the action to fiducial n.0, and not to fiducial n.0, n.1, n.2, ecc.
example:
fiducial 0 = dog.jpg
fiducial 0 rotate > 90° = dog_hungry.jpg
fiducial 1 = cat.jpg
fiducial 1 rotate > 90° = cat_hungry.jpg
I'm working on following code:
void draw() {
background(0);
Vector tuioObjectList = tuioClient.getTuioObjects();
for (int i=0;i<tuioObjectList.size();i++) {
TuioObject tobj = (TuioObject)tuioObjectList.elementAt(i);
pushMatrix();
int FID= tobj.getSymbolID();
float ANG= tobj.getAngle();
println("angle "+ tobj.getAngle());
translate(tobj.getScreenX(width), tobj.getScreenY(height));
if (FID==0) {
image(dog, 0, 0);
}
if (ANG >1.50) {
image(dog_hungry, 0, 0);
}
if (ANG >3) {
image(dog_happy, 0, 0);
}
if (ANG >4.70) {
image(dog_tired, 0, 0);
}
popMatrix();
}
}
1