Can I Invert OrbitControls.js drag control?

Hi guys,

I’m trying to create first-person camera move control on my web,
and I want to ask Can I invert OrbitControls.js mouse drag control.
Right now, both the pan and tilt directions are reversed.

I set the basic JS setup for OrbitControls + WASD position control,
please help with that!

It is not possible to configure reversed controls. You have to modify the code to implement this use case.

It is a small, but imo. great extra feature of the OrbitControls. Why not add it?: Sci fi (threeml.org)

var OrbitControls = function ( object, domElement ) {

this.reversed = false;

function handleMouseMoveRotate( event ) {
	...
	var inv = scope.reversed ? 1 : -1;
	rotateLeft(inv * 2 * Math.PI * rotateDelta.x / element.clientHeight ); // yes, height

	rotateUp(inv * 2 * Math.PI * rotateDelta.y / element.clientHeight );

OrbitControls can’t accommodate all possible use cases. We only support the most common ones so the class keeps maintainable.

1 Like

we would accept a pr for it: GitHub - pmndrs/three-stdlib: Stand-alone library of threejs examples designed to run without transpilation in node & browser the goal for that project currently is to tag along the original jsm with a bit more modern build and expanded feature set, it’s a community managed fork. it’s not a small project any longer if that’s a worry, the react space especially depends on it.