How to change PeasyCam position
in
Contributed Library Questions
•
1 year ago
Hi all,
Is it possible to change the PeasyCam position in a scene. The class just has a method getPosition() however I found no way to change the camera position. All I want is to view a 3D model (for now a simple cube) but not from the center of the screen. If I move the cube off the screen center, the rotation is incorrect (I want that the object is rotated from its center). See code below;
import peasy.*;
import processing.opengl.*;
PeasyCam cam;
PMatrix3D currCameraMatrix;
PGraphics3D g3;
void setup() {
size(400,400,OPENGL);
g3 = (PGraphics3D)g;
cam = new PeasyCam(this, 100);
}
void draw() {
background(0);
translate(-10,0,0);
box(30);
}
Thanks,
Clayton
1