I not sure where to limit TUIO cursors in the example code that they provide. I have looked and tweaked in several areas, but it has not yielded any results yet.
I've commented below in their code what I thought would work, but hasn't.
my comments are on line 11, line 35, line 38
any help would be appreciated, even if it is to tell me i can't do what i'm trying to do. it'd be nice to know.
thanks!
- void updateTuio()
- {
- textFont(font,18);
- float obj_size = object_size*scale_factor;
- float cur_size = cursor_size*scale_factor;
- Vector tuioObjectList = tuioClient.getTuioObjects();
- // i thought that limiting the iteration loop to i < list.size AND i < 1 would keep the loop from listening for any additional points in the list, but it is not the case. Also, changing i<tuioObjectList.size() to i<0 yields an error of 0 >= 0
- for (int i=0;i<tuioObjectList.size() && i < 1;i++) {
- TuioObject tobj = (TuioObject)tuioObjectList.elementAt(i);
- stroke(0);
- fill(0);
- pushMatrix();
- translate(tobj.getScreenX(width),tobj.getScreenY(height));
- rotate(tobj.getAngle());
- rect(-obj_size/2,-obj_size/2,obj_size,obj_size);
- popMatrix();
- // fill(255);
- // text(""+tobj.getSymbolID(), tobj.getScreenX(width), tobj.getScreenY(height));
- }
- for (int i=0;i<tuioCursorList.size();i++) {
- TuioCursor tcur = (TuioCursor)tuioCursorList.elementAt(i);
- Vector pointList = tcur.getPath();
- //changing the following if statement to 'if (pointList.size() > 0 && pointList.size < 2){ executeStuff();} makes it so that the cursor appears on screen only for a brief blip and then disappears.
- if (pointList.size() > 0) {
- // i created this conditional inside the previous conditional, and it works for displaying only 1 point. however, when an additional point appears, it takes over the cursor from the previous point. it hands it back to the lower index point when it disappears.
- if (i < 1){
- aBunchOfStuffGetsDoneHere();
- }
1