Scale and rotate a rect with a tuio blobs

Hi everyone,

I want to scale and rotate a rect with a pair of blobs using tuio protocole, I am using CCV tbeta and the addon tuio.

is there any example code on the web or any reference to do it.

you can have an array of ofxVec2f and transform them using ofxVectorMath. use one of the blobs as the centre of rotations and the reference for translations and the difference with the other one to scale and calculate the angle of rotation.

something like:

  
ofxVec2f currVector = blob2 - blob1;  
ofxVec2f prevVector = prevBlob2 - prevBlob1;  
for(int i=0; i<4; i++){  
   rect[i] += (blob1 - prevBlob1);  
   rect[i] += blob1;  
   rect[i].rotate(currVector.angle(prevVector);  
   rect[i] -= blob1;  
   rect[i] *= currVector.length() / prevVector.length();  
}  
prevBlob1 = blob1;  
prevBlob2 = blob2;  
  

How about to move/Resize a GUI winodw in Qt using CCV rather than default glut GUI ?

Thanks.

Hi,

This is how i try to do it but I still cant do it, can you help me?

rect_tuio.zip