How to set UpVector of camera?

Started by jumong, September 01, 2010, 04:35:24 PM

Previous topic - Next topic

jumong

hi,
I am developing simple program using camera, but here, I don't know how to set UpVector of camera
Help!!!

raft


jumong

#2
thank you for your help
In this function, what is meaning of direction, I don't know well...
It seems  simpleVector of lookAt function?

raft

it's the direction the camera should look into. you can place camera in infinite ways looking into same direction. upVector picks an orientation among these where up direction in camera space is the given upVector.

jumong

I did like follow
camera.setOrientation(vecCameraTarget, new SimpleVector(0,0,1));

then, all Object in screen disappeared
What am I doing wrong?

raft

in jPCT's coordinate system typical upVector is (0, -1, 0)
and the result also depends on where your objects and camera are in the scene.

paulscode

Also, make sure your vecCameraTarget vector is normalized, and also make sure that it forms a right-angle with whatever up-vector you use.