hi,
i'm doing a 3D reconstruction of
this video. It's working fine using a series of still images:
simply aligning them in 3D. it doesn't seem to work as applet, so
here's the app if you want to try.
what i'd like to do now, is replace the still images with video textures which are offset by some amount of frames to each other, so that the whole thing is moving.
i don't even know yet if the computer will be able to play that much video simultaneously, but i'm having a more basic problem here:
i'm using the JMCvideo library to load the video into openGL, and
the 3D translation of the video does not do what it should, in fact it does nothing. Code:import processing.opengl.*;
import peasy.*;
import javax.media.opengl.*;
import java.util.*;
import jmcvideo.*;
PGraphicsOpenGL pgl;
GL gl;
PeasyCam cam;
JMCMovieGL scan;
PFont font;
void setup()
{
size(800, 600, OPENGL);
font = createFont("Sans Serif", 20);
textFont(font);
cam = new PeasyCam(this, 1000);
cam.setRotations(.8, 0, 0);
cam.setMinimumDistance(50);
cam.setMaximumDistance(1200);
scan = new JMCMovieGL(this, "scan1.mov", RGB);
scan.loop();
}
void draw()
{
imageMode(CENTER);
background(100);
doGLStuff();
}
void drawSlices(int num)
{
for(int i = 0; i < num; i++)
{
pushMatrix();
translate(-scan.width/2, -scan.height/2, -i*100);
scan.image(gl, 0, 0, scan.width, scan.height);
text(nf(frameRate, 2, 1)+" fps", 20, height-20);
popMatrix();
}
}
void doGLStuff()
{
pgl = (PGraphicsOpenGL) g;
gl = pgl.beginGL();
gl.glDisable(GL.GL_DEPTH_TEST);
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);
drawSlices(10);
println("drawing frame " + frameCount);
pgl.endGL();
}
so the JMCVideoGL class has an image function, and i figured you could use it the same way as you would a PImage, however it doesn't translate like it should.
Instead it just draws the video 10 times at the same coordinates. On top of that, if you rotate the camera, the text(frameRate..) stuff seems to rotate in an entirely different
perspective than the video textures.
So i reckon i have to kind of wrap the video texture into the same gl context as the peasycam stuff… or something….?