TiagoCavalcante / r3f-native-orbitcontrols

OrbitControls for React Three Fiber in React Native
MIT License
72 stars 10 forks source link

minZoom and maxZoom not working #15

Closed ervibern closed 1 year ago

ervibern commented 1 year ago

Hi, thanks for this handy library for simple orbit controls - works for me on iOS physical device. The only thing I didn't manage to get working is zoom - tried multiple values (0.1, 1, 10, 100, etc) but they don't seem to change the zooming ability. I couldn't find how you implemented this in the library as it says maxZoom: infinity.


<Canvas shadows camera={camera}>
  <ambientLight />
  <pointLight intensity={LIGHT_INTENSITY} position={LIGHT_POSITION} />
  <OrbitControls enablePan={false} enableZoom maxZoom={1} rotateSpeed={0.5} />
  <Suspense fallback={null}>
    <Torus />
  </Suspense>
</Canvas>
TiagoCavalcante commented 1 year ago

@ervibern Thanks for using the library and creating the issue!

Before #17 the options minZoom and maxZoom were not used, instead of them there were minDistance and maxDistance (even though minZoom and maxZoom were mentioned in the documentation). Now I'm publish a new version with the fix

ervibern commented 1 year ago

Great @TiagoCavalcante - thanks for that. Awesome work!