import TUIO.*;
TuioProcessing tuioClient;
// these are some helper variables which are used
// to create scalable graphical feedback
float cursor_size = 15;
float object_size = 60;
float table_size = 760;
float scale_factor = 1;
//PFont font;
void setup()
{
//size(screen.width,screen.
height);
size(640,480);
noStroke();
fill(0);
smooth();
loop();
frameRate(30);
// we create an instance of the TuioProcessing client
// since we add "this" class as an argument the TuioProcessing class expects
// an implementation of the TUIO callback methods (see below)
tuioClient = new TuioProcessing(this);
}
void draw()
{
background(255);
Vector tuioObjectList = tuioClient.getTuioObjects();
for (int i=0;i<tuioObjectList.size();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(0);
//text(""+tobj.getSymbolID(), tobj.getScreenX(width), tobj.getScreenY(height));
}
Vector tuioCursorList = tuioClient.getTuioCursors();
for (int i=0;i<tuioCursorList.size();i+
+) {
TuioCursor tcur = (TuioCursor)tuioCursorList.
elementAt(i);
Vector pointList = tcur.getPath();
if (pointList.size()>0) {
stroke(0);
TuioPoint start_point = (TuioPoint)pointList.
firstElement();;
for (int j=0;j<pointList.size();j++) {
TuioPoint end_point = (TuioPoint)pointList.
elementAt(j);
line(start_point.getScreenX(
width),start_point.getScreenY(
height),end_point.getScreenX(
width),end_point.getScreenY(
height));
start_point = end_point;
}
stroke(0);
fill(0);
//ellipse( tcur.getScreenX(width), tcur.getScreenY(height),cur_
size,cur_size);
fill(0);
//text(""+ tcur.getCursorID(), tcur.getScreenX(width)-5, tcur.getScreenY(height)+5);
}
}
saveFrame("line00.jpg"); //float cur_size = cursor_size*scale_factor;
// size(630, 480);
//PImage img1;
//img1 = loadImage("test02.gif");
//image(img1, 0, 45);
}
// these callback methods are called whenever a TUIO event occurs
// called when an object is added to the scene
void addTuioObject(TuioObject tobj) {
println("add object "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle());
}
// called when an object is removed from the scene
void removeTuioObject(TuioObject tobj) {
println("remove object "+tobj.getSymbolID()+" ("+tobj.getSessionID()+")");
}
// called when an object is moved
void updateTuioObject (TuioObject tobj) {
println("update object "+tobj.getSymbolID()+" ("+tobj.getSessionID()+") "+tobj.getX()+" "+tobj.getY()+" "+tobj.getAngle()
+" "+tobj.getMotionSpeed()+" "+tobj.getRotationSpeed()+" "+tobj.getMotionAccel()+" "+tobj.getRotationAccel());
}
// called when a cursor is added to the scene
void addTuioCursor(TuioCursor tcur) {
println("add cursor "+tcur.getCursorID()+" ("+tcur.getSessionID()+ ") " +tcur.getX()+" "+tcur.getY());
}
// called when a cursor is moved
void updateTuioCursor (TuioCursor tcur) {
println("update cursor "+tcur.getCursorID()+" ("+tcur.getSessionID()+ ") " +tcur.getX()+" "+tcur.getY()
+" "+tcur.getMotionSpeed()+" "+tcur.getMotionAccel());
}
// called when a cursor is removed from the scene
void removeTuioCursor(TuioCursor tcur) {
println("remove cursor "+tcur.getCursorID()+" ("+tcur.getSessionID()+")");
}
// called after each message bundle
// representing the end of an image frame
void refresh(TuioTime bundleTime) {
redraw();
}
I want to save a frame every 30 second....(like refresh the same file every 30 second)