vue-threejs icon indicating copy to clipboard operation
vue-threejs copied to clipboard

orbit-controls can not pan and zoom

Open tdl1001 opened this issue 7 years ago • 1 comments

I use orbit and camera like sample:

      <orbit-controls :position="{x: 2, y: 2, z: 8}"
          :rotation="{ x: 2, y: 0, z: 3 }">
        <camera></camera>
      </orbit-controls>

I got warning like this when I try to pan or zoom

WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.

tdl1001 avatar May 21 '18 03:05 tdl1001

@fritx thank you for this powerful library! Is there any progress, or suggestion how to fix that?

From my research I found, that we have to add camera object as first parameter in the OrbitControls object.

new OrbitControls(camera, renderer.domElement)

Working example

I passed global camera object as props into OrbitControls.vue and implement it, but I cannot get updated scope.zoomSpeed in OrbitControls.js. And lost dragging around scene functionality.

Thanx :)

bebjakub avatar Sep 22 '18 08:09 bebjakub