I tried this out with PeasyCam... sort of works.. but I don't know much about stereo viewing. So to me it just looks like two images of the same thing. Don't understand how to make it pop out in 3d.
Code:
/**
stereo viewing taken from http://processinghacks.com/hacks:stereo_viewing
@author John Gilbertson
*/
import processing.opengl.*;
import peasy.*; //camera control
import javax.media.opengl.*;
GL gl;
PeasyCam cam;
void setup()
{
size(500,300,OPENGL);
gl=((PGraphicsOpenGL)g).gl; //We need this to set some OPENGL options.
perspective(PI/3.0,1,0.1,1000); //this is needed ot stop the images being squashed.
noStroke();
cam = new PeasyCam(this, 75);
cam.setMinimumDistance(width/14);
}
void draw()
{
ambientLight(64,64,64); //some lights to aid the effect.
pointLight(128,128,128,0,20,-50);
background(0);
fill(255);
// Left Eye
gl.glViewport(50,50,200,200); // This means anythign we draw will be limited to the left half of the screen.
pushMatrix();
box(30);
translate(0,0,30);
box(10);
popMatrix();
// Right Eye
gl.glViewport(250,50,200,200);
pushMatrix();
box(30);
translate(0,0,30);
box(10);
popMatrix();
}