let oldController;//已知的一个controller

 

//初始化旋转(鼠标左键的操作)

let position=oldController.object.position;

camera.position.set(position.x,position.y,position.z);

 

//初始化zoom(鼠标滚轮的操作)

camera.zoom=oldController.object.zoom;

camera.updateProjectionMatrix();//必须update

 

//初始化位移(鼠标右键的操作)

let newController=new THREE.OrbitControls(camera, canvas);

newController.target=oldController.target;

 

return newController;

 

相关文章:

  • 2021-09-19
  • 2021-12-16
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2021-09-25
  • 2021-05-24
  • 2021-07-28
相关资源
相似解决方案