Commit 6e81674b authored by amandaghassaei's avatar amandaghassaei

more vive changes

parent 721da210
...@@ -15,32 +15,26 @@ function initViveInterface(globals){ ...@@ -15,32 +15,26 @@ function initViveInterface(globals){
$status.html("No device connected."); $status.html("No device connected.");
$("#VRoptions").show(); $("#VRoptions").show();
connect();
var controls, controller1, controller2, effect;
var mesh = new THREE.Mesh(new THREE.CubeGeometry(1, 1,1 ), new THREE.MeshLambertMaterial({color:0xff0000})); var mesh = new THREE.Mesh(new THREE.CubeGeometry(1, 1,1 ), new THREE.MeshLambertMaterial({color:0xff0000}));
function setup(){ var controls = new THREE.VRControls(globals.threeView.camera);
controls.standing = true;
controls = new THREE.VRControls(globals.threeView.camera); // controllers
controls.standing = true; controller1 = new THREE.ViveController( 0 );
var controller1.standingMatrix = controls.getStandingMatrix();
globals.threeView.scene.add( controller1 );
// controllers var controller2 = new THREE.ViveController( 1 );
controller1 = new THREE.ViveController( 0 ); controller2.standingMatrix = controls.getStandingMatrix();
controller1.standingMatrix = controls.getStandingMatrix(); globals.threeView.scene.add( controller2 );
globals.threeView.scene.add( controller1 );
controller2 = new THREE.ViveController( 1 ); controller1.add(mesh.clone());
controller2.standingMatrix = controls.getStandingMatrix(); controller2.add(mesh.clone());
globals.threeView.scene.add( controller2 );
controller1.add(mesh.clone()); var effect = new THREE.VREffect(globals.threeView.renderer);
controller2.add(mesh.clone());
effect = new THREE.VREffect(globals.threeView.renderer); connect();
}
function connect(){ function connect(){
WEBVR.getVRDisplay( function ( display ) { WEBVR.getVRDisplay( function ( display ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment