How to implement camera pedestal movement?

70 views Asked by At

I am a newbie at threejs and customizing some application using threejs. In my job, I have to make a function so called, camera pedestal movement like below

https://rawgit.com/nselikoff/basic-camera-movement-three-js/master/index.html

Camera pedestal movement means

From top view, it works like zoom in/out from side view, it moves like up/down through Y-axis in Right-handed Cartesian threejs coordinates I hope my explanation helps your understanding.

At first, I simply thought it can be done by changing its Y position like below,

camera.position.y = camera.position.y + 2; //2 is arbitrary constant

From top view, it works fine. But from side view, camera doesn't move up or down through Y axis. It seems like rotating around the target of it.

I think from side view to implement pedestal movement, target of camera must be moved together with camera.

Could anybody give me good hints for Camera pedestal movement function?

Thanks a lot.

0

There are 0 answers