title: WebVR Extension with Basic Application Example
body: <p>I am trying to use the WebVR extension with a basic application. Instead of a 3D model in VR, the below html renders a 2D model. The code is mostly boilerplate except for where I call the WebVR extension. Thanks in advance!</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;!-- vr.html --&gt;
      &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no" /&gt;
      &lt;meta charset="utf-8"&gt;
  
      &lt;!-- The Viewer CSS --&gt;
      &lt;link rel="stylesheet" href="https://developer.api.autodesk.com/viewingservice/v1/viewers/style.min.css" type="text/css"&gt;
  
      &lt;!-- Developer CSS --&gt;
      &lt;style&gt;
          body {
              margin: 0;
          }
          #MyViewerDiv {
              width: 100%;
              height: 100%;
              margin: 0;
              background-color: #F0F8FF;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
      &lt;!-- The Viewer will be instantiated here --&gt;
      &lt;div id="MyViewerDiv"&gt;&lt;/div&gt;
  
      &lt;!-- The Viewer JS --&gt;
      &lt;script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/three.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js"&gt;&lt;/script&gt;
  
      &lt;!-- Developer JS --&gt;
      &lt;script&gt;
          var viewerApp;
          var options = {
              env: 'AutodeskProduction',
              // Here is the WebVR extension
              extensions: ['Autodesk.Viewing.WebVR'],
              getAccessToken: function(onGetAccessToken) {
                  //
                  // TODO: Replace static access token string below with call to fetch new token from your backend
                  // Both values are provided by Forge's Authentication (OAuth) API.
                  //
                  // Example Forge's Authentication (OAuth) API return value:
                  // {
                  //    "access_token": "&lt;YOUR_APPLICATION_TOKEN&gt;",
                  //    "token_type": "Bearer",
                  //    "expires_in": 86400
                  // }
                  //
                  var accessToken = {{ accessToken }};
                  var expireTimeSeconds = 60 * 30;
                  onGetAccessToken(accessToken, expireTimeSeconds);
              }
  
          };
          var documentId = {{ documentID }};
          // var config = {
              // extensions: ['Autodesk.Viewing.WebVR'],
              // experimental: ['webVR_orbitModel']
          // };
          Autodesk.Viewing.Initializer(options, function(){
              viewerApp = new Autodesk.Viewing.ViewingApplication('MyViewerDiv');
              viewerApp.registerViewer(viewerApp.k3D, Autodesk.Viewing.Private.GuiViewer3D);
              viewerApp.loadDocument(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
          });
  
          function onDocumentLoadSuccess(doc) {
  
              // We could still make use of Document.getSubItemsWithProperties()
              // However, when using a ViewingApplication, we have access to the **bubble** attribute,
              // which references the root node of a graph that wraps each object from the Manifest JSON.
              var viewables = viewerApp.bubble.search({'type':'geometry'});
              if (viewables.length === 0) {
                  console.error('Document contains no viewables.');
                  return;
              }
  
              // Choose any of the avialble viewables
              viewerApp.selectItem(viewables[0].data, onItemLoadSuccess, onItemLoadFail);
          }
  
          function onDocumentLoadFailure(viewerErrorCode) {
              console.error('onDocumentLoadFailure() - errorCode:' + viewerErrorCode);
          }
  
          function onItemLoadSuccess(viewer, item) {
              console.log('onItemLoadSuccess()!');
              console.log(viewer);
              console.log(item);
  
              // Congratulations! The viewer is now ready to be used.
              console.log('Viewers are equal: ' + (viewer === viewerApp.getCurrentViewer()));
          }
  
          function onItemLoadFail(errorCode) {
              console.error('onItemLoadFail() - errorCode:' + errorCode);
          }
  
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Where {{ documentID }} is my urn and {{ accessToken }} is my token. </p>