Skip to content

Commit

Permalink
Examples: Added OrbitControls to webvr_paint and webvr_sculpt.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Nov 27, 2019
1 parent 33a9795 commit a8c3ea3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion examples/webvr_paint.html
Expand Up @@ -19,14 +19,15 @@
<script type="module">

import * as THREE from '../build/three.module.js';
import { OrbitControls } from './jsm/controls/OrbitControls.js';
import { TubePainter } from './jsm/misc/TubePainter.js';
import { WEBVR } from './jsm/vr/WebVR.js';

var container;
var camera, scene, renderer;
var controller1, controller2;

var painter;
var controls, painter;

var up = new THREE.Vector3( 0, 1, 0 );

Expand All @@ -44,6 +45,10 @@
camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.01, 50 );
camera.position.set( 0, 1.6, 3 );

controls = new OrbitControls( camera, container );
controls.target.set( 0, 1.6, 0 );
controls.update();

var geometry = new THREE.BoxBufferGeometry( 0.5, 0.8, 0.5 );
var material = new THREE.MeshStandardMaterial( {
color: 0x444444,
Expand Down
8 changes: 6 additions & 2 deletions examples/webvr_sculpt.html
Expand Up @@ -19,15 +19,15 @@
<script type="module">

import * as THREE from '../build/three.module.js';

import { OrbitControls } from './jsm/controls/OrbitControls.js';
import { MarchingCubes } from './jsm/objects/MarchingCubes.js';
import { WEBVR } from './jsm/vr/WebVR.js';

var container;
var camera, scene, renderer;
var controller1, controller2;

var blob;
var controls, blob;

var points = [];

Expand All @@ -46,6 +46,10 @@
camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.02, 50 );
camera.position.set( 0, 1.6, 3 );

controls = new OrbitControls( camera, container );
controls.target.set( 0, 1.6, 0 );
controls.update();

var geometry = new THREE.BoxBufferGeometry( 0.5, 0.8, 0.5 );
var material = new THREE.MeshStandardMaterial( {
color: 0x444444,
Expand Down

0 comments on commit a8c3ea3

Please sign in to comment.