www.jpct.net
jPCT - a 3d engine for Java => Support => Topic started by: Zlobnyi Serg on September 15, 2004, 03:50:06 pm
-
I need to rotate camera around some point (camera.lookAt(somepoint)) in worldspace. Is there embedded routines to implement this action, or which way is easiest to rotate camera around?
Thank you!
-
One way is to place the camera at "somepoint", do the rotation and move the camera backwards. Something like
camera.setPosition(somepoint);
camera.rotateCameraY(0.1f);
camera.moveCamera(Camera.CAMERA_MOVEOUT, 20f);
camera.lookAt(somepoint); //Maybe not needed in this case...depends on the application
Another solution would be to create a dummy object that rotates around "somepoint" and set the camera to its position every frame. In this case, the lookAt() is definitely needed.