We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to do object picking with rays in Processing. Everything works fine, except I cannot find the right 'up' vector of the camera. I am using Peasy library.
I could get the cameraUp vector by:
right = PVector.cross(view,new PVector(0,0,1));
cameraUp = PVector.cross(view, right);
However the problem is that when I am orbiting with the camera the up vector (0,0,1) gets rotated. I would like to find the up vector of the rotated coordinate system. Peasy lets you access the pitch, yaw and roll.
I tried doing it with:
up.x = cos(cam.getRotations())*sin(cam.getRotations()); up.y = -cos(cam.getRotations()); up.z = sin(cam.getRotations())*sin(cam.getRotations());
and a few similar versions, but I just can't get it to work. it might be due to peasy defining the axis differently.
Any hint on how I could solve this?
Any answer would be much appreciated:)