How to use the FlyControls function from three

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

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;
fork icon0
star icon3
watch icon5

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;
fork icon1
star icon1
watch icon2

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
fork icon0
star icon0
watch icon5

+ 3 other calls in file

Other functions in three

Sorted by popularity

function icon

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