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();
185
870
40
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
34
216
8
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
17
31
4
+ 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 );
3
7
0
+ 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,
3
7
0
+ 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()
2
14
0
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 };
2
7
3
+ 8 other calls in file
GitHub: VeinKowal/veins
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();
0
1
0
+ 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();
0
0
2
+ 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
0
0
1
+ 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 };
0
0
1
+ 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;
0
0
0
+ 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; } },
0
0
0
+ 5 other calls in file
three.Vector3 is the most popular function in three (22341 examples)