|
@@ -21,9 +21,17 @@
|
|
|
<h2>Workflow</h2>
|
|
|
|
|
|
<p>
|
|
|
- You have to include [link:https://github.com/mrdoob/three.js/blob/master/examples/js/vr/WebVR.js WebVR.js]
|
|
|
- into your project. *WEBVR.createButton()* does two important things: First, it creates a button which indicates
|
|
|
- VR compatibility. Second, it initiates a VR session if the user activates the button. The only thing you have
|
|
|
+ First, you have to include [link:https://github.com/mrdoob/three.js/blob/master/examples/js/vr/WebVR.js WebVR.js]
|
|
|
+ into your project.
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <code>
|
|
|
+<script src="/path/to/WebVR.js"></script>
|
|
|
+ </code>
|
|
|
+
|
|
|
+ <p>
|
|
|
+ *WEBVR.createButton()* does two important things: It creates a button which indicates
|
|
|
+ VR compatibility. Besides, it initiates a VR session if the user activates the button. The only thing you have
|
|
|
to do is to add the following line of code to your app.
|
|
|
</p>
|
|
|
|
|
@@ -32,7 +40,7 @@ document.body.appendChild( WEBVR.createButton( renderer ) );
|
|
|
</code>
|
|
|
|
|
|
<p>
|
|
|
- Next, you have to tell your instance of *WebGLRenderer* to enable VR rendering:
|
|
|
+ Next, you have to tell your instance of *WebGLRenderer* to enable VR rendering.
|
|
|
</p>
|
|
|
|
|
|
<code>
|
|
@@ -45,11 +53,11 @@ renderer.vr.enabled = true;
|
|
|
</p>
|
|
|
|
|
|
<code>
|
|
|
-function animate() {
|
|
|
+renderer.setAnimationLoop( function () {
|
|
|
|
|
|
- renderer.setAnimationLoop( render );
|
|
|
+ renderer.render( scene, camera );
|
|
|
|
|
|
-}
|
|
|
+} );
|
|
|
</code>
|
|
|
|
|
|
<h2>Next Steps</h2>
|