OrbitControls speed on manual rotate

Love the OrbitControls. Is it possible to change the orbit speed on manual rotation? It’s a bit too fast atm.

Original Post on Discord

by user 427134081860501507

Hello there – we have an experimental AI bot :robot: that might be able to help you with your question. Would you like to try this out?

How it works:
Reply to the messages of the bot that end with a thread_id to interact with it and ask follow-up questions. You can also mention the bot directly in this channel to get help.

Help requested: please wait a moment…

is this what youre looking for? (damping factor)
Capto_Capture_2024-01-17_04-12-21_PM.png

Hello Snorulf, yes you can certainly change the orbit speed for manual rotation by modifying the autoRotateSpeed property of the OrbitControls. This property adjusts the rotation speed when autoRotate is enabled. Additionally, if you’re looking to adjust the damping effect which can influence the “feel” of the rotation, you can modify the dampingFactor property. The enableDamping property must be set to true for the dampingFactor to have any effect (see the documentation).

Here is an example of how to adjust both properties:

// Assume 'myOrbitControls' is your instance of OrbitControls
myOrbitControls.autoRotateSpeed = 0.5; // Lower value for slower rotation speed
myOrbitControls.enableDamping = true;
myOrbitControls.dampingFactor = 0.1; // Adjust for a less "tight" feel when manually rotating

Adjust the values to your preference for a slower rotation speed.

1 messages left GPT 4
thread_ZJOc2SAo6FSl2qd6ZEo1vyEN
Thanks for your feedback!

No, I’d like the rotational orbit movement to be relative to the distance travelled by the mouse cursor. Now I get two full rotations when going horizontally from one window edge to the other.

by user 427134081860501507

You should be able to set rotateSpeed/panSpeed of the underlying three.js OrbitControls object

Thanks I figured that out literally one minute ago :smile:
Works perfect, thank you guys!

by user 427134081860501507

:slightly_smiling_face: great to hear!