Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update demo for Three.js r95 #20

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 7 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
}

</style>
<script src="https://cdn.rawgit.com/mrdoob/three.js/r87/build/three.js"></script>
<script src="https://cdn.rawgit.com/mrdoob/three.js/r87/examples/js/vr/WebVR.js"></script>
<script src="https://cdn.rawgit.com/mrdoob/three.js/r95/build/three.js"></script>
<script src="https://cdn.rawgit.com/mrdoob/three.js/r95/examples/js/vr/WebVR.js"></script>
<script src="https://cdn.rawgit.com/dataarts/dat.guiVR/master/build/datguivr.js"></script>
<script src="VRController.js"></script>
</head>
Expand All @@ -54,10 +54,7 @@
// Here’s how to download and configure one that does:
// https://webvr.rocks

WEBVR.checkAvailability().catch( function( message ){

document.body.appendChild( WEBVR.getMessageContainer( message ))
})
// WebVR button indicates availability directly


// Regardless, let’s kick off the Three.js basics here:
Expand All @@ -72,7 +69,6 @@
renderer.setPixelRatio( window.devicePixelRatio )
renderer.setSize( window.innerWidth, window.innerHeight )
renderer.vr.enabled = true
renderer.vr.standing = true
renderer.shadowMap.enabled = true
renderer.shadowMap.type = THREE.PCFSoftShadowMap
document.body.appendChild( renderer.domElement )
Expand All @@ -90,11 +86,7 @@
// This button is important. It toggles between normal in-browser view
// and the brand new WebVR in-your-goggles view!

WEBVR.getVRDisplay( function( display ){

renderer.vr.setDevice( display )
document.body.appendChild( WEBVR.getButton( display, renderer.domElement ))
})
document.body.appendChild( WEBVR.createButton( renderer ) );


// Should things change in the future we’ve got you covered:
Expand Down Expand Up @@ -242,7 +234,7 @@
// instead of in your hands! And for seated experiences this will have no
// effect, so safe to do either way:

controller.standingMatrix = renderer.vr.getStandingMatrix()
if ( !controller.armModel ) controller.standingMatrix = renderer.vr.getStandingMatrix()


// And for 3DOF (seated) controllers you need to set the controller.head
Expand Down Expand Up @@ -335,7 +327,8 @@
if( torus.rotation.y > Math.PI ) torus.rotation.y -= ( Math.PI * 2 )// Keep DAT GUI display tidy!
renderer.render( scene, camera )
}
renderer.animate( update )

renderer.setAnimationLoop( update )



Expand Down