0
votes

I'm using currently developing a scene with threejs, and am using the orbit controls to rotate the camera around the scene. I've noticed that every now and again, when rotating around, it sometimes starts throwing my camera all around the place, then it seems to resolve itself and rotates smoothly.

I've seen a few posts online about an orbit control wobble, but they're issue seems to mainly be when the camera is static, this happens on and off, only when rotating.

small video of what I mean

You can see it's wobbling around, then I focus into object and back out, then it's fine.

I've seen some solutions involving near and far clipping planes, mine are currently:

nearClippingPlane = 0.1

farClippingPlane = 10000

Would you say it's something to do with that? And therefore I should explore those solutions further?

Or is it a different issue?

Thanks guys, and once again, sorry for what is probably a trivial question...

EDIT:

Here's the renderloop:

https://ibb.co/hLLmqU

Here's another video where I'm trying to avoid mousing over the cubes:

https://screencast-o-matic.com/watch/cFQXoCqmlS

1

1 Answers

0
votes

Looks like it applies both orbitcontrols rotate and the zoom on the cubes you have done when raycast intersects them. Notice how it works fine when you grab space without the raycast hitting the cubes and when you grab cube it starts zooming and going back every frame. Try changing zoom event from mousedown to click.