-
Hi, I'm using this for a 360 image and I need the camera to stay fixed at (0,0,0) If I update the camera position the controls stop working. I've seen this post https://codeworkshop.dev/blog/2020-04-03-adding-orbit-controls-to-react-three-fiber/ which kind of has a fix but seems out of date, the extend functionality doesn't make o Is there a simple way to lock the camera position with OrbitControls and just rotate the camera? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You could set the min/max distance to something very small.
This will make the https://codesandbox.io/s/zoomed-orbit-controls-forked-ot5im7?file=/src/index.js:879-931 Alternatively, you could use |
Beta Was this translation helpful? Give feedback.
-
Thanks that's awesome |
Beta Was this translation helpful? Give feedback.
You could set the min/max distance to something very small.
<OrbitControls minDistance={0} maxDistance={0.01} />
This will make the
OrbitControls
behave like it's zoomed all the way in.https://codesandbox.io/s/zoomed-orbit-controls-forked-ot5im7?file=/src/index.js:879-931
Alternatively, you could use
PointerLockControls
if you want a more direct (FPS) user control of the camera.https://codesandbox.io/s/pointer-lock-controls-gzn0c5