Thanks for the reply. Here's the code I'm working with:
Code:
import processing.core.*;
import damkjer.ocd.*;
public class CameraTest extends PApplet{
Camera cam1;
public void setup() {
size(600,400,P3D);
cam1 = new Camera(this,
0,0,width,
0,0,0);
}
public void draw() {
background(255);
cam1.feed();
fill(210,0,0);
box(50); // red box
translate(200,0);
fill(0,210,0);
box(50); // green box
fill(0,0,210);
translate(200,0);
box(50); // blue box
}
public void mouseDragged()
{
if (mouseButton == LEFT) {
cam1.circle(radians(mouseX - pmouseX));
cam1.arc(radians(mouseY - pmouseY));
} else if (mouseButton == RIGHT) {
cam1.zoom(radians(mouseY - pmouseY) / 2.0f);
}
}
public static void main(String[] args) {
PApplet.main(new String[] { CameraTest.class.getName() });
}
}
What I'd like is for the red box to be positioned in the center of the applet initially, but when you rotate the view, the camera rotates around the green box. As I said before, I tried messing around with the camera and target XYZ attributes, but this only changes the camera in relation to the boxes. What I want is to position the camera in relation to the the applet window (e.g. shift it to the right).
Andrew