Skip to content

Commit e1f93e1

Browse files
committed
Examples: Added OrbitControls to webxr_vr_dragging.
1 parent 9987d59 commit e1f93e1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/webxr_vr_dragging.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<script type="module">
2020

2121
import * as THREE from '../build/three.module.js';
22+
import { OrbitControls } from './jsm/controls/OrbitControls.js';
2223
import { VRButton } from './jsm/webxr/VRButton.js';
2324

2425
var container;
@@ -28,7 +29,7 @@
2829
var raycaster, intersected = [];
2930
var tempMatrix = new THREE.Matrix4();
3031

31-
var group;
32+
var controls, group;
3233

3334
init();
3435
animate();
@@ -44,6 +45,10 @@
4445
camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.1, 10 );
4546
camera.position.set( 0, 1.6, 3 );
4647

48+
controls = new OrbitControls( camera, container );
49+
controls.target.set( 0, 1.6, 0 );
50+
controls.update();
51+
4752
var geometry = new THREE.PlaneBufferGeometry( 4, 4 );
4853
var material = new THREE.MeshStandardMaterial( {
4954
color: 0xeeeeee,

0 commit comments

Comments
 (0)