Camera rotation - which way is easiest?

Started by Zlobnyi Serg, September 15, 2004, 03:50:06 PM

Previous topic - Next topic

Zlobnyi Serg

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!

EgonOlsen

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.