Processing 加工及保养;反应-从舞台上移除电影

Processing 加工及保养;反应-从舞台上移除电影,processing,Processing,我用处理和反应制作了一个交互式表格,每个符号播放一个视频。我的问题是,当你删除一个符号时,视频会保留下来,不会重置舞台,因此当添加另一个符号时,它会在已经播放的视频下方播放。我基本上需要做的是,一旦一个符号被移除,阶段就会重置/清除。任何帮助都将不胜感激。代码如下 /* TUIO processing demo - part of the reacTIVision project http://reactivision.sourceforge.net/ Copyrigh

我用处理和反应制作了一个交互式表格,每个符号播放一个视频。我的问题是,当你删除一个符号时,视频会保留下来,不会重置舞台,因此当添加另一个符号时,它会在已经播放的视频下方播放。我基本上需要做的是,一旦一个符号被移除,阶段就会重置/清除。任何帮助都将不胜感激。代码如下

/*
    TUIO processing demo - part of the reacTIVision project
    http://reactivision.sourceforge.net/

    Copyright (c) 2005-2009 Martin Kaltenbrunner <mkalten@iua.upf.edu>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

// we need to import the TUIO library
// and declare a TuioProcessing client variable
import TUIO.*;
import java.util.*;
import processing.video.*;
TuioProcessing tuioClient;

// these are some helper variables which are used
// to create scalable graphical feedback
float cursor_size = 15;
float object_size = 0;
float table_size = 760;
float scale_factor = 1;
PFont font;
PImage img;
Movie theMov; 
Movie theMov2;

void setup()
{
  //size(screen.width,screen.height);
  size(720,480);
  noStroke();
  fill(0);
  img = loadImage("background.jpeg");
  theMov = new Movie(this, "gibi.mov");
  theMov2 = new Movie(this, "rick.mov");

  loop();
  frameRate(30);
  //noLoop();

  font = createFont("Arial", 18);
  scale_factor = height/table_size;

  // 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);
}

// within the draw method we retrieve a Vector (List) of TuioObject and TuioCursor (polling)
// from the TuioProcessing client and then loop over both lists to draw the graphical feedback.
void draw()
{

  background(247,73,2);
  textFont(font,18*scale_factor);
  float obj_size = object_size*scale_factor; 


  image(theMov, 0, 0);
  image(theMov2, 0, 0);

  Vector tuioObjectList = tuioClient.getTuioObjects();
  for (int i=0;i<tuioObjectList.size();i++) {
     TuioObject tobj = (TuioObject)tuioObjectList.elementAt(i);
     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));
   }

}


// 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());

     if ( tobj.getSymbolID() == 0) {
      theMov.play();
  }

    if ( tobj.getSymbolID() == 5) {
      theMov2.play(); 
  }

}

// called when an object is removed from the scene
void removeTuioObject(TuioObject tobj) {
  println("remove object "+tobj.getSymbolID()+" ("+tobj.getSessionID()+")");
    if ( tobj.getSymbolID() == 0) {
      theMov.stop();

  } 
    if ( tobj.getSymbolID() == 5) {
      theMov2.stop();
  } 
}

// 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 after each message bundle
// representing the end of an image frame
void refresh(TuioTime bundleTime) { 
  redraw();
}

void movieEvent(Movie m) { 
  m.read(); 
}




TUIO: missing or wrong 'addTuioCursor(TuioCursor tcur)' method implementation
TUIO:missing or wrong 'removeTuioCursor(TuioCursor tcur)' method implementation
TUIO: missing or wrong 'updateTuioCursor(TuioCursor tcur)' method implementation
add object 0 (3) 0.37709242 0.8826896 0.0
update object 0 (3) 0.37709242 0.8737366 0.0742998 0.2419723 0.0 6.5397916 0.0
update object 0 (3) 0.37709242 0.867628 0.0742998 0.21064281 0.0 -1.080327 0.0
update object 0 (3) 0.37597793 0.86093885 0.0742998 0.19375265 0.0 -0.48257622 0.0
update object 0 (3) 0.37597793 0.8532117 0.0742998 0.23415594 0.0 1.2243422 0.0
update object 0 (3) 0.37896088 0.847547 0.0742998 0.15614879 0.0 -1.9026133 0.0
update object 0 (3) 0.38109976 0.84274954 0.0742998 0.1811261 0.0 0.86128664 0.0
update object 0 (3) 0.37981042 0.838495 0.0742998 0.116989255 0.0 -1.6878119 0.0
update object 0 (3) 0.38065997 0.838495 0.0742998 0.033981323 0.0 -3.3203173 0.0
update object 0 (3) 0.38252023 0.8398745 0.020077623 0.048248682 -0.17978598 0.29723665 -3.7455413
update object 0 (3) 0.38252023 0.8426642 0.020077623 0.09963129 0.0 1.835093 6.4209275
update object 0 (3) 0.38413188 0.8452217 0.020077623 0.10424032 0.0 0.1589322 0.0
update object 0 (3) 0.38413188 0.8452217 0.020077623 0.0 0.0 -4.009243 0.0
update object 0 (3) 0.38325775 0.8440129 0.020077623 0.033149652 0.0 0.73665893 0.0
update object 0 (3) 0.38325775 0.8427188 0.020077623 0.04313787 0.0 0.33294064 0.0
update object 0 (3) 0.38325775 0.8414247 0.020077623 0.05391985 0.0 0.4492492 0.0
update object 0 (3) 0.38222247 0.8414247 0.020077623 0.032352652 0.0 -0.67397493 0.0
update object 0 (3) 0.3830283 0.8414247 0.020077623 0.01714534 0.0 -0.32355985 0.0
update object 0 (3) 0.3830283 0.8424627 0.020077623 0.03992365 0.0 0.8760888 0.0
update object 0 (3) 0.3830283 0.8424627 0.020077623 0.0 0.0 -1.596946 0.0
update object 0 (3) 0.3830283 0.84123003 0.020077623 0.037354052 0.0 1.131941 0.0
update object 0 (3) 0.382105 0.84123003 0.020077623 0.026379995 0.0 -0.31354448 0.0
update object 0 (3) 0.381026 0.83904475 0.020077623 0.081238225 0.0 1.8286079 0.0
update object 0 (3) 0.381026 0.83904475 0.020077623 0.0 0.0 -2.3210924 0.0
update object 0 (3) 0.381026 0.83904475 0.020077623 0.0 0.0 0.0 0.0
update object 0 (3) 0.37948263 0.8377506 0.020077623 0.06294223 0.0 1.9669446 0.0
update object 0 (3) 0.37948263 0.8377506 0.020077623 0.0 0.0 -1.851242 0.0
update object 0 (3) 0.37948263 0.8377506 0.020077623 0.0 0.0 0.0 0.0
update object 0 (3) 0.37759778 0.8357668 0.020077623 0.08048391 0.0 2.367174 0.0
update object 0 (3) 0.37759778 0.8357668 6.280155 0.0 -0.11492891 -2.5151222 -3.5915282
update object 0 (3) 0.3761473 0.8357668 6.280155 0.04395427 0.0 1.3319477 3.4826941
update object 0 (3) 0.3761473 0.8336429 6.280155 0.060682636 0.0 0.47795326 0.0
update object 0 (3) 0.3761473 0.8336429 6.280155 0.0 0.0 -1.8963323 0.0
update object 0 (3) 0.3761473 0.8336429 6.280155 0.0 0.0 0.0 0.0
update object 0 (3) 0.37695312 0.8336429 0.0 0.02441912 0.014613922 0.7399733 0.44284612
update object 0 (3) 0.37695312 0.8336429 6.2801733 0.0 -0.013315989 -0.6783089 -0.77583086
update object 0 (3) 0.37695312 0.83588284 0.0010060358 0.072256215 0.020629212 2.3308456 1.0950066
update object 0 (3) 0.37695312 0.83588284 6.2821803 0.0 -0.010325174 -2.3308456 -0.99852866
update object 0 (3) 0.37695312 0.83588284 0.0080239 0.0 0.04105623 0.0 1.4680401
update object 0 (3) 0.37780267 0.83588284 6.2811527 0.026547907 -0.050016034 0.82962203 -2.846008
update object 0 (3) 0.37780267 0.83588284 0.0030150663 0.0 0.012552409 -0.41481102 0.97763187
update object 0 (3) 0.37780267 0.83447266 0.0030150663 0.040291037 0.0 1.1511725 -0.35864025
update object 0 (3) 0.37780267 0.83447266 0.0030150663 0.0 0.0 -1.2209406 0.0
update object 0 (3) 0.37780267 0.83447266 0.0030150663 0.0 0.0 0.0 0.0
update object 0 (3) 0.37780267 0.83548 0.0030150663 0.031478703 0.0 0.9837094 0.0
update object 0 (3) 0.37780267 0.8365726 0.0030150663 0.036420427 0.0 0.16472414 0.0
update object 0 (3) 0.37780267 0.8365726 0.0030150663 0.0 0.0 -1.0405836 0.0
update object 0 (3) 0.37780267 0.8365726 6.2781296 0.0 -0.03568064 0.0 -0.9911289
update object 0 (3) 0.37780267 0.83493704 6.2781296 0.054518383 0.0 1.8172795 1.1893547
update object 0 (3) 0.37780267 0.8339297 0.0010060358 0.02878053 0.027564982 -0.73536724 0.7875709
update object 0 (3) 0.37780267 0.8339297 6.274067 0.0 -0.051979534 -0.9284042 -2.565952
update object 0 (3) 0.37780267 0.83292246 6.274067 0.028778825 0.0 0.82225215 1.4851296
update object 0 (3) 0.37780267 0.83292246 0.001011122 0.0 0.048852257 -0.87208563 1.4803715
update object 0 (3) 0.37780267 0.83421654 6.27816 0.041744404 -0.030989556 1.3465937 -2.5755424
update object 0 (3) 0.37876967 0.83421654 0.0040691537 0.027628625 0.041355457 -0.40330797 2.0670004
update object 0 (3) 0.37876967 0.83421654 6.2811527 0.0 -0.029428765 -0.83723104 -2.1449766
update object 0 (3) 0.37876967 0.83421654 6.2811527 0.0 0.0 0.0 0.9196489
update object 0 (3) 0.37876967 0.8320927 6.2811527 0.06636977 0.0 2.0740552 0.0
update object 0 (3) 0.37876967 0.8320927 6.2811527 0.0 0.0 -1.8436048 0.0
update object 0 (3) 0.37768522 0.8320927 6.2811527 0.032862026 0.0 0.995819 0.0
update object 0 (3) 0.37768522 0.8320927 6.2811527 0.0 0.0 -1.0954009 0.0
update object 0 (3) 0.37768522 0.8320927 6.2811527 0.0 0.0 0.0 0.0
update object 0 (3) 0.37865222 0.8320927 6.2811527 0.02844123 0.0 0.8365067 0.0
update object 0 (3) 0.37865222 0.83096933 6.2811527 0.025531108 0.0 -0.06613915 0.0
update object 0 (3) 0.37865222 0.8295045 6.2811527 0.056340143 0.0 1.1849629 0.0
update object 0 (3) 0.37865222 0.8276982 6.2811527 0.0410527 0.0 -0.3474419 0.0
update object 0 (3) 0.37865222 0.8276982 6.2811527 0.0 0.0 -1.7105291 0.0
update object 0 (3) 0.37865222 0.8276982 6.2811527 0.0 0.0 0.0 0.0
update object 0 (3) 0.37865222 0.8256836 6.2811527 0.05444804 0.0 1.4715686 0.0
update object 0 (3) 0.37865222 0.8256836 6.2811527 0.0 0.0 -2.0941553 0.0
update object 0 (3) 0.37865222 0.8243041 6.2811527 0.04756862 0.0 1.6402973 0.0
update object 0 (3) 0.37865222 0.8243041 6.2811527 0.0 0.0 -1.3591034 0.0
update object 0 (3) 0.37865222 0.8262572 6.2811527 0.052787162 0.0 1.4266801 0.0
update object 0 (3) 0.38131282 0.8319766 6.2811527 0.23362696 0.0 6.697769 0.0
update object 0 (3) 0.38131282 0.8319766 6.2811527 0.0 0.0 -6.8713803 0.0
update object 0 (3) 0.38131282 0.8319766 6.2811527 0.0 0.0 0.0 0.0
remove object 0 (3)
add object 5 (4) 0.3838997 0.7569657 0.0
update object 5 (4) 0.3838997 0.74766445 1.4853827 0.26574987 0.0 7.5928535 0.0
update object 5 (4) 0.3820777 0.7410607 1.4853827 0.19572896 0.0 -2.000597 0.0
update object 5 (4) 0.3820777 0.7364408 1.4853827 0.10499765 0.0 -2.0620756 0.0
update object 5 (4) 0.3820777 0.73477453 1.4853827 0.057456825 0.0 -1.6393389 0.0
update object 5 (4) 0.38115984 0.73477453 1.4853827 0.035301536 0.0 -0.8521265 0.0
update object 5 (4) 0.38115984 0.7383939 1.4853827 0.097820885 0.0 1.6897122 0.0
update object 5 (4) 0.38267866 0.7416719 1.4853827 0.10322214 0.0 0.15432154 0.0
update object 5 (4) 0.38267866 0.7416719 1.4853827 0.0 0.0 -4.1288853 0.0
update object 5 (4) 0.38267866 0.7416719 1.4853827 0.0 0.0 0.0 0.0
update object 5 (4) 0.38355276 0.7416719 1.4853827 0.024974687 0.0 0.7135625 0.0
update object 5 (4) 0.38355276 0.74281234 1.4853827 0.04751732 0.0 0.9392763 0.0
update object 5 (4) 0.38355276 0.74281234 1.4853827 0.0 0.0 -1.3576376 0.0
update object 5 (4) 0.38355276 0.74281234 1.4853827 0.0 0.0 0.0 0.0
update object 5 (4) 0.38355276 0.7438743 1.4853827 0.03218109 0.0 0.9751846 0.0
update object 5 (4) 0.3850224 0.7457728 1.4853827 0.07275257 0.0 1.229439 0.0
update object 5 (4) 0.3850224 0.7457728 1.4853827 0.0 0.0 -2.2046237 0.0
update object 5 (4) 0.3850224 0.7457728 1.4853827 0.0 0.0 0.0 0.0
update object 5 (4) 0.3850224 0.7446494 1.4853827 0.029562335 0.0 0.77795625 0.0
update object 5 (4) 0.3850224 0.7446494 1.4853827 0.0 0.0 -0.9854112 0.0
update object 5 (4) 0.3850224 0.7446494 1.4853827 0.0 0.0 0.0 0.0
update object 5 (4) 0.3850224 0.74582744 1.4853827 0.03681332 0.0 1.1504161 0.0
update object 5 (4) 0.38592112 0.74582744 1.4853827 0.028084962 0.0 -0.27276114 0.0
update object 5 (4) 0.38592112 0.74582744 1.4853827 0.0 0.0 -0.85105944 0.0
update object 5 (4) 0.38592112 0.74703616 1.4853827 0.03555066 0.0 1.0456077 0.0
update object 5 (4) 0.38592112 0.74703616 1.4853827 0.0 0.0 -1.1109581 0.0
update object 5 (4) 0.38592112 0.7480674 1.4853827 0.029463427 0.0 0.8418122 0.0
update object 5 (4) 0.38727325 0.7480674 1.4853827 0.04097404 0.0 0.34880644 0.0
update object 5 (4) 0.38727325 0.7504541 1.4853827 0.0769919 0.0 1.1618665 0.0
update object 5 (4) 0.38846976 0.751919 1.4853827 0.054039527 0.0 -0.6557822 0.0
update object 5 (4) 0.38846976 0.751919 1.4853827 0.0 0.0 -1.1497772 0.0
update object 5 (4) 0.38846976 0.7534999 1.4853827 0.034368556 0.0 0.7471425 0.0
update object 5 (4) 0.38846976 0.7534999 1.4853827 0.0 0.0 -1.2274483 0.0
update object 5 (4) 0.38846976 0.7534999 1.4853827 0.0 0.0 0.0 0.0
update object 5 (4) 0.38846976 0.7545311 1.4853827 0.042965014 0.0 1.7902089 0.0
update object 5 (4) 0.38846976 0.75573987 1.4853827 0.048351288 0.0 0.21545097 0.0
update object 5 (4) 0.38846976 0.75573987 1.4853827 0.0 0.0 -1.4220966 0.0
update object 5 (4) 0.38846976 0.75573987 1.4853827 0.0 0.0 0.0 0.0
update object 5 (4) 0.38936844 0.75927395 1.4853827 0.11395484 0.0 3.5610886 0.0
update object 5 (4) 0.39017427 0.76237434 1.4853827 0.04928318 0.0 -0.99494874 0.0
update object 5 (4) 0.39233226 0.76737326 1.4853827 0.15556657 0.0 3.0366688 0.0
update object 5 (4) 0.3962385 0.7761623 1.4853827 0.2914553 0.0 4.11784 0.0
update object 5 (4) 0.3962385 0.7761623 1.4853827 0.0 0.0 -7.87717 0.0
update object 5 (4) 0.3962385 0.7761623 1.4853827 0.0 0.0 0.0 0.0
remove object 5 (4)
/*
TUIO处理演示-Reactiviion项目的一部分
http://reactivision.sourceforge.net/
版权所有(c)2005-2009 Martin Kaltenbrunner
这个程序是自由软件;您可以重新分发和/或修改它
它是根据GNU通用公共许可证的条款发布的
自由软件基金会;许可证的第2版,或
(由您选择)任何更高版本。
这个节目的发布是希望它会有用,
但无任何保证;甚至没有任何关于
适销性或适合某一特定目的。见
有关更多详细信息,请参阅GNU通用公共许可证。
您应该已经收到GNU通用公共许可证的副本
与此同时,;如果没有,请写信给自由软件
基金会,59寺庙广场,套房330,波士顿,MA 02111-1307美国
*/
//我们需要导入TUIO库
//并声明一个TuioProcessing客户端变量
进口屠宰场*;
导入java.util.*;
导入处理。视频。*;
TuioProcessing tuioClient;
//这些是使用的一些辅助变量
//创建可伸缩的图形反馈
浮动光标_size=15;
浮动对象大小=0;
浮动台_尺寸=760;
浮动比例系数=1;
字体;
皮马杰;
电影theMov;
电影theMov2;
无效设置()
{
//尺寸(屏幕、宽度、屏幕、高度);
规模(720480);
仰泳();
填充(0);
img=loadImage(“background.jpeg”);
theMov=新电影(这是“gibi.mov”);
theMov2=新电影(这是“rick.mov”);
loop();
帧率(30);
//noLoop();
font=createFont(“Arial”,18);
比例系数=高度/桌子尺寸;
//我们创建TuioProcessing客户端的一个实例
//由于我们将“this”类添加为TuioProcessing类所期望的参数
//TUIO回调方法的实现(见下文)
tuioClient=新的TuioProcessing(this);
}
//在draw方法中,我们检索TuioObject和TuioCursor的向量(列表)(轮询)
//从TuioProcessing客户端,然后在两个列表上循环以绘制图形反馈。
作废提款()
{
背景(247,73,2);
textFont(字体,18*比例系数);
浮动对象大小=对象大小*比例系数;
图像(theMov,0,0);
图像(theMov2,0,0);
Vector tuioObjectList=tuioClient.getTuioObjects();

对于(int i=0;i,所以我进一步研究了这个问题,并最终使其发挥作用。问题是我一直在错误的位置绘制电影,因为它们需要在绘制部分的向量中,并且我需要一个if语句在显示某个符号时调用它们。代码如下:

/*
    TUIO processing demo - part of the reacTIVision project
    http://reactivision.sourceforge.net/

    Copyright (c) 2005-2009 Martin Kaltenbrunner <mkalten@iua.upf.edu>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

// we need to import the TUIO library
// and declare a TuioProcessing client variable
import TUIO.*;
import java.util.*;
import processing.video.*;
TuioProcessing tuioClient;

// these are some helper variables which are used
// to create scalable graphical feedback
float cursor_size = 15;
float object_size = 0;
float table_size = 760;
float scale_factor = 1;
PFont font;
PImage img;
Movie theMov; 
Movie theMov2;
PImage bg;



void setup()
{
  //size(screen.width,screen.height);
  size(1280,720);
  noStroke();
  fill(0);
  //bg = loadImage("bg.png");
  theMov = new Movie(this, "isobar.mov");

  loop();
  frameRate(30);
  //noLoop();

  font = createFont("Arial", 18);
  scale_factor = height/table_size;

  // 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);
}

// within the draw method we retrieve a Vector (List) of TuioObject and TuioCursor (polling)
// from the TuioProcessing client and then loop over both lists to draw the graphical feedback.
void draw()
{

  //background(bg);
  textFont(font,18*scale_factor);
  float obj_size = object_size*scale_factor; 



  Vector tuioObjectList = tuioClient.getTuioObjects();
  for (int i=0;i<tuioObjectList.size();i++) {
     TuioObject tobj = (TuioObject)tuioObjectList.elementAt(i);
     pushMatrix();
     //translate(tobj.getScreenX(width),tobj.getScreenY(height));
     rotate(tobj.getAngle());
     rect(-obj_size/2,-obj_size/2,obj_size,obj_size);
     popMatrix();

     if (tobj.getSymbolID()==0){
     image(theMov, 0, 0);
     }

    if (tobj.getSymbolID()==5){
     image(theMov2, 0, 0);
     }

     //fill(255);
     //text(""+tobj.getSymbolID(), tobj.getScreenX(width), tobj.getScreenY(height));
   }

}


// 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());


      if (tobj.getSymbolID() == 0){
        theMov.play();
      }

      if (tobj.getSymbolID() == 5){
        theMov2.play();
      }

     if (tobj.getSymbolID()==1){
     text(""+tobj.getSymbolID(), tobj.getScreenX(width), tobj.getScreenY(height));
     fill(255);
     translate(tobj.getScreenX(width),tobj.getScreenY(height));
     }

}

// called when an object is removed from the scene
void removeTuioObject(TuioObject tobj) {
  println("remove object "+tobj.getSymbolID()+" ("+tobj.getSessionID()+")");

    if ( tobj.getSymbolID() == 0) {
      theMov.stop();
    }    

        if ( tobj.getSymbolID() == 5) {
      theMov2.stop();
    }

}

// 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 after each message bundle
// representing the end of an image frame
void refresh(TuioTime bundleTime) { 
  redraw();
}

void movieEvent(Movie m) { 
  m.read(); 
} 
/*
TUIO处理演示-Reactiviion项目的一部分
http://reactivision.sourceforge.net/
版权所有(c)2005-2009 Martin Kaltenbrunner
此程序是免费软件;您可以重新发布和/或修改它
它是根据GNU通用公共许可证的条款发布的
自由软件基金会;许可证的第2版;或
(由您选择)任何更高版本。
这个节目的发布是希望它会有用,
但没有任何保证;甚至没有对
适销性或适用于特定用途。请参阅
有关更多详细信息,请参阅GNU通用公共许可证。
您应该已经收到GNU通用公共许可证的副本
与此程序一起;如果没有,则写入自由软件
基金会,59寺庙广场,套房330,波士顿,MA 02111-1307美国
*/
//我们需要导入TUIO库
//并声明一个TuioProcessing客户端变量
进口屠宰场*;
导入java.util.*;
导入处理。视频。*;
TuioProcessing tuioClient;
//这些是使用的一些辅助变量
//创建可伸缩的图形反馈
浮动光标_size=15;
浮动对象大小=0;
浮动台_尺寸=760;
浮动比例系数=1;
字体;
皮马杰;
电影theMov;
电影theMov2;
皮马杰bg;
无效设置()
{
//尺寸(屏幕、宽度、屏幕、高度);
规模(1280720);
仰泳();
填充(0);
//bg=loadImage(“bg.png”);
theMov=新电影(这是“isobar.mov”);
loop();
帧率(30);
//noLoop();
font=createFont(“Arial”,18);
比例系数=高度/桌子尺寸;
//我们创建TuioProcessing客户端的一个实例
//由于我们将“this”类添加为TuioProcessing类所期望的参数
//TUIO回调方法的实现(见下文)
tuioClient=新的TuioProcessing(this);
}
//在draw方法中,我们检索TuioObject和TuioCursor的向量(列表)(轮询)
//从TuioProcessing客户端,然后在两个列表上循环以绘制图形反馈。
作废提款()
{
//背景(bg);
textFont(字体,18*比例系数);
浮动对象大小=对象大小*比例系数;
Vector tuioObjectList=tuioClient.getTuioObjects();

对于(int i=0;我能在你的问题中添加日志记录吗?我更新了日志记录-不确定它是否有多大帮助,只是我添加了一个符号并删除了它。从你的日志判断回调调用是正确的。但是你肯定应该实现TUIO需要的方法。另外,我不明白图像(theMov,0,0);图像是什么(theMov2,0,0);是吗?看起来你总是画这两个图像?不管它们是否真的在播放?theMov2不是总是画在theMov1上吗?