Allow inversion of OrbitControls

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 );

Author: Fantashit

1 thought on “Allow inversion of OrbitControls

  1. @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?

Comments are closed.