Skip to content

Commit

Permalink
add controls with min/max distance
Browse files Browse the repository at this point in the history
  • Loading branch information
gero3 committed Aug 10, 2022
1 parent 99f63b9 commit baec5e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion examples/webgl_raycaster_bvh.html
Expand Up @@ -147,7 +147,9 @@

} );

new OrbitControls( camera, renderer.domElement );
const controls = new OrbitControls( camera, renderer.domElement );
controls.minDistance = 5;
controls.maxDistance = 75;

// set up gui
const gui = new GUI();
Expand Down
6 changes: 4 additions & 2 deletions examples/webgl_raycaster_sprite.html
Expand Up @@ -66,8 +66,10 @@
camera.position.set( 15, 15, 15 );
camera.lookAt( scene.position );

new OrbitControls( camera, renderer.domElement );

const controls = new OrbitControls( camera, renderer.domElement );
controls.minDistance = 15;
controls.maxDistance = 250;

// add sprites

const sprite1 = new THREE.Sprite( new THREE.SpriteMaterial( { color: '#69f' } ) );
Expand Down
6 changes: 4 additions & 2 deletions examples/webxr_ar_dragging.html
Expand Up @@ -54,8 +54,10 @@
camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.1, 10 );
camera.position.set( 0, 0, 3 );

new OrbitControls( camera, container );

const controls = new OrbitControls( camera, container );
controls.minDistance = 0;
controls.maxDistance = 8;

scene.add( new THREE.HemisphereLight( 0x808080, 0x606060 ) );

const light = new THREE.DirectionalLight( 0xffffff );
Expand Down

0 comments on commit baec5e0

Please sign in to comment.