GSVideo Multi
in
Contributed Library Questions
•
1 year ago
Hi to all.
I am trying to set multiple videos and trigger each one of them with TUIO, but the following procedure does not work, as it displays the first video ok, but when I add a second, third and so on it displays wrong videos. Can you point out where this is wrong?
S.
Initialization
- tex = new GLTexture[maxMovies];
- myMovies = new GSMovie[maxMovies];
- for (int i = 0; i < myMovies.length; i ++ ) {
- println(i);
- myMovies[i] = new GSMovie(this, i+1 + ".mov");
- myMovies[i].loop();
- myMovies[i].pause();
- tex[i] = new GLTexture(this, i+1);
- tex[i].putPixelsIntoTexture(myMovies[i]);
- }
Drawing
- for (int i=0;i<tuioObjectList.size();i++){
- TuioObject tobj = (TuioObject)tuioObjectList.elementAt(i);
- stroke(0);
- fill(120);
- if (i == 0){
- pushMatrix();
- translate(tobj.getScreenX(width),tobj.getScreenY(height));
- ellipse (0,0,70,70);
- rotate(tobj.getAngle());
- myMovies[0].loadPixels();
- myMovies[0].updatePixels();
- myMovies[0].play();
- image(myMovies[0],obj_size/2,obj_size/2);
- popMatrix();
- fill(255);
- text(""+tobj.getSymbolID(), tobj.getScreenX(width), tobj.getScreenY(height));
- }
- if (i == 1){
- pushMatrix();
- translate(tobj.getScreenX(width),tobj.getScreenY(height));
- ellipse (0,0,70,70);
- rotate(tobj.getAngle());
- myMovies[1].loadPixels();
- myMovies[1].updatePixels();
- myMovies[1].play();
- image(myMovies[1],obj_size/2,obj_size/2);
- popMatrix();
- fill(255);
- text(""+tobj.getSymbolID(), tobj.getScreenX(width), tobj.getScreenY(height));
- }
- if (i == 2){
- pushMatrix();
- translate(tobj.getScreenX(width),tobj.getScreenY(height));
- ellipse (0,0,70,70);
- rotate(tobj.getAngle());
- myMovies[2].loadPixels();
- myMovies[2].updatePixels();
- myMovies[2].play();
- image(myMovies[1],obj_size/2,obj_size/2);
- popMatrix();
- fill(255);
- text(""+tobj.getSymbolID(), tobj.getScreenX(width), tobj.getScreenY(height));
- }
1