This is a slight modification of the example given in the OCD reference for feed(). The initial view is looking forward to the boxes at 0,0,0 and works. Clicking the mouse switches the camera feed to the second camera which is looking straight down at 0,0,0 and shows nothing. This seems to be a problem when looking straight up or straight down. I've tried all combinations for the 7th, 8th, and 9th parameters (camera orientation) with the same result. What am I doing wrong?
import damkjer.ocd.*;
Camera camera1, camera2;
void setup()
{
size(100, 100, P3D);
camera1 = new Camera(this, 0, 0, 200, 0, 0, 0, 0, -1, 0);
camera2 = new Camera(this, 0, -200, 0, 0, 0, 0, 0, 0, -1);
}
void draw()
{
background(204);
lights();
if (!mousePressed)
{
camera1.feed(); // default camera looking forward
}
else
{
camera2.feed(); // alternate camera looking down
}
fill(0, 128, 255);
pushMatrix(); // a blue box at origin
translate(0, 0, 0);
rotateY(PI/3);
box(50);
popMatrix();
fill(192, 0, 0);
pushMatrix(); // a smaller red box above it
translate(0, -50, 0);
rotateY(PI/2);
box(30);
popMatrix();
}