hello all,
i'm now getting into a problem with OCD, which i think very useful one, though. my problem is that OCD seems not to refine the UP direction from its default state... even if i set the UP direction to (0,0,1), OCD seems to ignore or define it as (0,1,0)...
although i searched whether someone had the same problem, i couldn't find it out so far. is this my misunderstanding or a known issue or due to the difference of right- or left hand system? please try the code below. you can see my problem if you mouse-clicked. please help me!
Code:import damkjer.ocd.*;
Camera cam;
float cam_field_of_view; //view angle
float cam_aspect;//aspect ratio
float cam_shotLength;//distance from camera to objects
float cam_nearClippingPLane, cam_farClippingPLane; //distance from the camera to each clipping plane
void setup(){
size(1024,768, P3D);
cam_field_of_view = PI/3.0;
cam_aspect = (float)width/(float)height;
cam_shotLength = height * 0.5 / tan(cam_field_of_view * 0.5);
cam_nearClippingPLane = 0.1 * cam_shotLength;
cam_farClippingPLane = 10 * cam_shotLength;
cam = new Camera(this,
500.0, 0.0, 0.0,
0.0, 0.0, 0.0,
0.0, 0.0, 1.0,
cam_field_of_view, cam_aspect,
cam_nearClippingPLane, cam_farClippingPLane);
}
void draw(){
cam.feed();
//camera(500,1000,500,0,0,0,0,0,1);
drawAxes();
}
void mouseClicked() {
float[] up = cam.up();
println("Up X: " + up[0]);
println("Up Y: " + up[1]);
println("Up Z: " + up[2]);
}
void drawAxes(){
//origin
noStroke();
fill(200,0,0);
sphere(10);
strokeWeight(10);
//x axis
color myred = color(255,5,135);
stroke(myred);
line(0, 0, 0, 500, 0, 0);
//y axis
color mygreen = color(171,255,6);
stroke(mygreen);
line(0, 0, 0, 0, 500, 0);
//z axis
color myblue = color(18,116,245);
stroke(myblue);
line(0, 0, 0, 0, 0, 500);
}