Skip to content

Commit

Permalink
Remove map controls, usage of FlyOrbitControls
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Nov 3, 2024
1 parent 7441a8a commit b0ea46b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 37 deletions.
15 changes: 6 additions & 9 deletions example/mars.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TilesRenderer } from '3d-tiles-renderer';
import { TilesRenderer, EnvironmentControls } from '3d-tiles-renderer';
import { DebugTilesPlugin } from '3d-tiles-renderer/plugins';
import {
Scene,
Expand All @@ -9,7 +9,6 @@ import {
Group,
FogExp2,
} from 'three';
import { FlyOrbitControls } from './src/controls/FlyOrbitControls.js';
import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js';

let camera, controls, scene, renderer;
Expand Down Expand Up @@ -42,15 +41,12 @@ function init() {

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

// controls
controls = new FlyOrbitControls( camera, renderer.domElement );
controls.screenSpacePanning = false;
controls.minDistance = 1;
controls.maxDistance = 2000;
controls.maxPolarAngle = Math.PI / 2;
controls.baseSpeed = 0.1;
controls.fastSpeed = 0.2;
controls = new EnvironmentControls( scene, camera, renderer.domElement );
controls.minZoomDistance = 2;
controls.cameraRadius = 1;

// lights
const dirLight = new DirectionalLight( 0xffffff );
Expand Down Expand Up @@ -107,6 +103,7 @@ function render() {

requestAnimationFrame( render );

controls.update();
camera.updateMatrixWorld();

groundTiles.errorTarget = params.errorTarget;
Expand Down
28 changes: 0 additions & 28 deletions example/src/lib/MapControls.js

This file was deleted.

0 comments on commit b0ea46b

Please sign in to comment.