How to use the MOUSE function from three

Find comprehensive JavaScript three.MOUSE code examples handpicked from public code repositorys.

74
75
76
77
78
79
80
81
82
83

// The four arrow keys
this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };

// Mouse buttons
this.mouseButtons = { LEFT: THREE.MOUSE.LEFT, MIDDLE: THREE.MOUSE.MIDDLE, RIGHT: THREE.MOUSE.RIGHT };

// for reset
this.target0 = this.target.clone();
this.position0 = this.object.position.clone();
fork icon185
star icon870
watch icon40

76
77
78
79
80
81
82
83
84

// The four arrow keys
this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };

// Mouse buttons
this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };

////////////
// internals
fork icon34
star icon216
watch icon8

62
63
64
65
66
67
68
69
70
71
 * `Event` for pointer interactions which should trigger different
 * interaction states.
 */
this.mouseButtons = { 
  LEFT: THREE.MOUSE.ROTATE, 
  MIDDLE: THREE.MOUSE.ZOOM, 
  RIGHT: THREE.MOUSE.PAN,
};

// internals
fork icon17
star icon31
watch icon4

+ 29 other calls in file

2573
2574
2575
2576
2577
2578
2579
2580
2581
2582

	}

	break;

case THREE.MOUSE.PAN:
	if ( event.ctrlKey || event.metaKey || event.shiftKey ) {

		if ( scope.enableRotate === false ) return;
		handleMouseDownRotate( event );
fork icon3
star icon7
watch icon0

+ 143 other calls in file

1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
}; // Mouse buttons

this.mouseButtons = {
	LEFT: THREE.MOUSE.ROTATE,
	MIDDLE: THREE.MOUSE.DOLLY,
	RIGHT: THREE.MOUSE.PAN
}; // Touch fingers

this.touches = {
	ONE: THREE.TOUCH.ROTATE,
fork icon3
star icon7
watch icon0

+ 135 other calls in file

74
75
76
77
78
79
80
81
82
83

// The four arrow keys
this.keys = {LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40}

// Mouse buttons
this.mouseButtons = {ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT}

// for reset
this.target0 = this.target.clone()
this.position0 = this.object.position.clone()
fork icon2
star icon14
watch icon0

68
69
70
71
72
73
74
75
76

// The four arrow keys
this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };

// Mouse buttons
this.mouseButtons = { LEFT: THREE.MOUSE.ROTATE, MIDDLE: THREE.MOUSE.DOLLY, RIGHT: THREE.MOUSE.PAN };

// Touch fingers
this.touches = { ONE: THREE.TOUCH.ROTATE, TWO: THREE.TOUCH.DOLLY_PAN };
fork icon2
star icon7
watch icon3

+ 8 other calls in file

41
42
43
44
45
46
47
48
49
50
51
};
exports.keys = keys;
var mouseButtons = {
  LEFTCLICK: THREE.MOUSE.LEFT,
  MIDDLECLICK: THREE.MOUSE.MIDDLE,
  RIGHTCLICK: THREE.MOUSE.RIGHT
};
var currentPressedButton; // starting camera position and orientation target


var startPosition = new THREE.Vector3();
fork icon0
star icon1
watch icon0

+ 2 other calls in file

73
74
75
76
77
78
79
80
81
82

// The four arrow keys
this.keys = {LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40};

// Mouse buttons
this.mouseButtons = {ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT};

// for reset
this.target0 = this.target.clone();
this.position0 = this.object.position.clone();
fork icon0
star icon0
watch icon2

+ 55 other calls in file

574
575
576
577
578
579
580
581
582
  RIGHT: 39,
  BOTTOM: 40
}; // Mouse buttons

this.mouseButtons = {
  ORBIT: THREE.MOUSE.LEFT,
  ZOOM: THREE.MOUSE.MIDDLE,
  PAN: THREE.MOUSE.RIGHT
}; // for reset
fork icon0
star icon0
watch icon1

+ 20 other calls in file

75
76
77
78
79
80
81
82
83

// The four arrow keys
this.keys = { LEFT: 'ArrowLeft', UP: 'ArrowUp', RIGHT: 'ArrowRight', BOTTOM: 'ArrowDown' };

// Mouse buttons
this.mouseButtons = { LEFT: three.MOUSE.ROTATE, MIDDLE: three.MOUSE.DOLLY, RIGHT: three.MOUSE.PAN };

// Touch fingers
this.touches = { ONE: three.TOUCH.ROTATE, TWO: three.TOUCH.DOLLY_PAN };
fork icon0
star icon0
watch icon1

+ 5 other calls in file

13
14
15
16
17
18
19
20
21
22
23
24
25
26


THREE.MapControls = function (object, domElement) {


    let control = new OrbitControls(object, domElement);


    control.mouseButtons.LEFT = THREE.MOUSE.PAN;
    control.mouseButtons.RIGHT = THREE.MOUSE.ROTATE;


    control.touches.ONE = THREE.TOUCH.PAN;
    control.touches.TWO = THREE.TOUCH.DOLLY_ROTATE;
fork icon0
star icon0
watch icon0

+ 3 other calls in file

477
478
479
480
481
482
483
484
485
486
487
488
				camControls.maxAzimuthAngle = Infinity; // radians


				camControls.minDistance = 3;
				camControls.maxDistance = 7;


				camControls.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT};
				this.levelSwitch = 0;
				break;
		}
},
fork icon0
star icon0
watch icon0

+ 5 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)