/** * Rotate * * Example for the pogg library by Octavi Estape. * It plays a Theora movie that you can rotate with the mouse. */ import pogg.*; TheoraMovie myMovie; void setup() { frameRate(10); size(320, 240); //TheoraMovie.printLogs(true); myMovie = new TheoraMovie(this, "BugsShort.ogg"); myMovie.loop(); smooth(); } void draw() { background(0); myMovie.read(); float angle = (mouseX-(float)width/(float)2)/((float)width/(float)2)*PI; pushMatrix(); translate(width/2, mouseY); rotate(angle); translate(-myMovie.width/2, -myMovie.height/2); image(myMovie, 0, 0); popMatrix(); }
Comments