Skip to content

Commit b0ea46b

Browse files
committed
Remove map controls, usage of FlyOrbitControls
1 parent 7441a8a commit b0ea46b

File tree

2 files changed

+6
-37
lines changed

2 files changed

+6
-37
lines changed

example/mars.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TilesRenderer } from '3d-tiles-renderer';
1+
import { TilesRenderer, EnvironmentControls } from '3d-tiles-renderer';
22
import { DebugTilesPlugin } from '3d-tiles-renderer/plugins';
33
import {
44
Scene,
@@ -9,7 +9,6 @@ import {
99
Group,
1010
FogExp2,
1111
} from 'three';
12-
import { FlyOrbitControls } from './src/controls/FlyOrbitControls.js';
1312
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js';
1413

1514
let camera, controls, scene, renderer;
@@ -42,15 +41,12 @@ function init() {
4241

4342
camera = new PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 4000 );
4443
camera.position.set( 20, 10, 20 );
44+
camera.lookAt( 0, 0, 0 );
4545

4646
// controls
47-
controls = new FlyOrbitControls( camera, renderer.domElement );
48-
controls.screenSpacePanning = false;
49-
controls.minDistance = 1;
50-
controls.maxDistance = 2000;
51-
controls.maxPolarAngle = Math.PI / 2;
52-
controls.baseSpeed = 0.1;
53-
controls.fastSpeed = 0.2;
47+
controls = new EnvironmentControls( scene, camera, renderer.domElement );
48+
controls.minZoomDistance = 2;
49+
controls.cameraRadius = 1;
5450

5551
// lights
5652
const dirLight = new DirectionalLight( 0xffffff );
@@ -107,6 +103,7 @@ function render() {
107103

108104
requestAnimationFrame( render );
109105

106+
controls.update();
110107
camera.updateMatrixWorld();
111108

112109
groundTiles.errorTarget = params.errorTarget;

example/src/lib/MapControls.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)