a question about camera.lookat()

Started by qjvictor, January 11, 2007, 08:50:25 PM

Previous topic - Next topic

qjvictor

camera.lookat()  at an object,  it will put the object in the center of the screen.  Can the camera look at the object but the object is not in the center, ie, in the left or right part of the screen. notice that the object will keep on moving.

cyberkilla

once its facing, in the center of the screen, perhaps you can rotate the camera manually to put it off center.
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

qjvictor

Thanks for the reply.

Can I get the rotate angle of the camera comparied with the init position?

The problem is that how I know the angle's value?

EgonOlsen

You can get the camera's rotation matrix (you may have to invert it depending on your needs) and derive the rotation angles from this like here: http://www.jpct.net/forum/viewtopic.php?t=576
However, this code is untested yet...at least by me. May work, may not...

halcor

Maybe you can parent an empty object to the object of interest and then camera.lookAt() that empty object. For example, place an empty between the eyes of a head of a human mesh, parent the empty to the mesh and camera.lookAt() the empty - you get camera tracking on the eyes :)