How to use the FlyControls function from three
Find comprehensive JavaScript three.FlyControls code examples handpicked from public code repositorys.
GitHub: avocadojesus/hackaholics
![avocadojesus profile picture](/avocadojesus.png?size=40)
45 46 47 48 49 50 51 52 53 54
camera.position.z = radius * 5; scene = new THREE.Scene(); scene.fog = new THREE.FogExp2( 0x000000, 0.00000025 ); controls = new THREE.FlyControls( camera ); controls.movementSpeed = 1000; controls.domElement = container; controls.rollSpeed = Math.PI / 24;
GitHub: Suixinlei/vrjs
![Suixinlei profile picture](/Suixinlei.png?size=40)
34 35 36 37 38 39 40 41 42 43
renderer.setPixelRatio( window.devicePixelRatio ); renderer.setSize(width, height); renderer.domElement.style.position = 'absolute'; container.appendChild(renderer.domElement); controls = new THREE.FlyControls( camera, renderer.domElement ); controls.movementSpeed = 1000; controls.rollSpeed = Math.PI / 24; controls.autoForward = false; controls.dragToLook = false;
207 208 209 210 211 212 213 214 215 216
switch (mode) { case 'fly': if (this.controls) { this.controls.dispose() } // this.controls = new THREE.FlyControls(this.camera, this.renderer.domElement, { movementSpeed: 0.01 }) // this.controls.enable() this.controls = new THREE.FlyControls(this.camera, this.renderer.domElement) this.controls.movementSpeed = 0.01 this.controls.rollSpeed = 0.01 this.keyMap = {} break
+ 3 other calls in file
three.Vector3 is the most popular function in three (22341 examples)