question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow inversion of OrbitControls

See original GitHub issue

It would be really helpful if somehow I could invert the OrbitControls, optionally changing the following function:

https://github.com/mrdoob/three.js/blob/dev/examples/js/controls/OrbitControls.js#L431

to use either:

// Normal
rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );
//Inverted
rotateLeft( 2 * Math.PI * -rotateDelta.x / element.clientWidth * scope.rotateSpeed );

and

// Normal
rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );
//Inverted
rotateUp( 2 * Math.PI * -rotateDelta.y / element.clientHeight * scope.rotateSpeed );

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

13reactions
WestLangleycommented, Oct 18, 2016

@andrewhosgood You should be able to achieve what you want by negating controls.rotateSpeed.

However, I am trying to understand what you are doing that requires such a change. Is your scene a panorama, and is your camera viewing a sphere or box from the inside?

1reaction
andrewhosgoodcommented, Oct 19, 2016

@WestLangley Yes, we are viewing a sphere from the inside. Setting the controls.rotateSpeed = -1 worked a treat! I missed this due to looking at the same problem for too long.

I think you can close this issue now. Thank you all for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Orbitcontrol rotation side inversion - three.js forum
I need to change the orbitcontrol as inversion. i.e., If I rotate the object to right side using the OrbitControl, then the rotation...
Read more >
Orbit Controls cannot initialize properly - three.js
All i want is to load an stl file and have some orbit controls to rotate around it. EDIT: Look at all these...
Read more >
Three js, React Three Fiber, React Three Drei Tutorial 2022
We'd be creating our own Perspective camera, manipulate it, and then control it with OrbitControls, and bind the camera rotation with our ...
Read more >
@react-three/drei - npm
Some controls allow you to set makeDefault , similar to, for instance, ... Drei currently exports OrbitControls , MapControls ...
Read more >
Adding OrbitControls to React Three Fiber - Code Workshop
It is very configurable and can do some cool stuff like restrict the maximum angle of rotation, allow or disallow zooming, and lock...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found