0

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.

정준용
  • 21
  • 3
  • 2
    (1) You need to show sufficient code so it is clear what you are doing. (2) `misc_controls_orbit.html` may do what you want if you modify the example and set `controls.screenSpacePanning = true;` – WestLangley May 17 '21 at 11:22
  • Oh many thanks to your comment. I am going to update more specific code soon. And I will try to check your comment. – 정준용 May 18 '21 at 05:43
  • controls.screenSpacePanning option works well to my code. many thanks again~ – 정준용 May 20 '21 at 08:30

0 Answers0