Skip to content

Commit

Permalink
adjustments to documentation and making UI better for samples
Browse files Browse the repository at this point in the history
  • Loading branch information
DanAndersen committed Nov 19, 2013
1 parent 730d456 commit 143acb8
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 148 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Basic Usage
- Plug in your Oculus Rift.
- Press "Connect" in the Cupola VR Viewer app. In the provided examples, you may need to click "toggle render mode" to get into Rift mode.

If you need to refresh the page, you can go to the URL address bar and press Enter.

Note: due to security restrictions in Chrome packaged apps, `file:///` URLs are not supported. You must remotely host the WebGL simulation, or locally on `localhost`.

Supporting Cupola in Your VR Application
----------------------------------------

Expand Down
49 changes: 46 additions & 3 deletions app/js/cupola_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ var viewerGettingStarted = function() {
$('#modal-help-intro').modal();
};




//----------------------------

// GUI
Expand All @@ -190,7 +193,7 @@ var actionObj = {
sendConfig: viewerSendConfig,
toggleConnect: viewerToggleConnect,
toggleFullscreen: viewerToggleFullscreen,
url: "google.com",
url: "",
updateDeviceConfig: viewerUpdateDeviceConfig,
uploadConfigFiles: viewerUploadConfigFiles
};
Expand All @@ -203,13 +206,41 @@ var toggleFullscreenController = actionGuiFolder.add(actionObj, 'toggleFullscree

actionGuiFolder.open();





var goToUrl = function(url) {
urlController.setValue(url);
submitUrl(url);
};

var viewerSampleRings = function() {
goToUrl("http://danandersen.bitbucket.org/rings.html");
};

var viewerSampleFirstPerson = function() {
goToUrl("http://danandersen.bitbucket.org/first_person.html");
};








var helpGuiFolder = gui.addFolder('Help');

var helpObj = {
gettingStarted: viewerGettingStarted
gettingStarted: viewerGettingStarted,
sampleRings: viewerSampleRings,
sampleFirstPerson: viewerSampleFirstPerson
};

var gettingStartedController = helpGuiFolder.add(helpObj, 'gettingStarted').name("Getting Started");
helpGuiFolder.add(helpObj, 'sampleRings').name("Sample #1: 'Rings'");
helpGuiFolder.add(helpObj, 'sampleFirstPerson').name("Sample #2: 'Oculus Bridge First Person'");

helpGuiFolder.open();

Expand Down Expand Up @@ -299,4 +330,16 @@ var onKeyUp = function(e) {
}
};

document.addEventListener('keyup', onKeyUp, false);
document.addEventListener('keyup', onKeyUp, false);









window.onload = function() {
viewerSampleRings();
};
12 changes: 10 additions & 2 deletions app/window.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ <h2>Example environments:</h2>

<p>While in Rift mode, use the WSAD keys to move around. Check the "help" button inside the simulation for additional control information.</p>

<h2>Cupola VR Viewer Configuration</h2>
<h2>Cupola VR Viewer Configuration (experimental)</h2>

<ul>
<li>To use your Oculus configuration data and send device/profile-specific data to the simulation, check out the <b>Config</b> section.</li>

<li>If the orientation data coming in from the Rift feels like it's consistently behind, try adjusting the <b>Predict time</b> slider in the <b>Config</b> section.</p>

<li>Currently configuration import is experimental and does not persist after you shutdown Cupola VR Viewer.</li>
</ul>


Expand All @@ -76,7 +78,13 @@ <h2>For more information</h2>
</div>


<webview id="sim-webview" src="http://danandersen.bitbucket.org/first_person.html"></webview>
<!--
Two samples available at:
http://danandersen.bitbucket.org/rings.html
http://danandersen.bitbucket.org/first_person.html
-->

<webview id="sim-webview"></webview>



Expand Down
141 changes: 0 additions & 141 deletions examples/js/connect.js

This file was deleted.

5 changes: 4 additions & 1 deletion examples/js/first_person.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var mouse, time;
var controls;
var clock;

var useRift = false;
var useRift = true;

var riftCam;

Expand Down Expand Up @@ -193,6 +193,9 @@ function init(){
*/

riftCam = new THREE.OculusRiftEffect(renderer);

// make sure it loads up to fill the window right
onResize();
}


Expand Down
5 changes: 4 additions & 1 deletion examples/js/rings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var mouse, time;
var controls;
var clock;

var useRift = false;
var useRift = true;

var riftCam;

Expand Down Expand Up @@ -229,6 +229,9 @@ function init(){
cupola.connect();

riftCam = new THREE.OculusRiftEffect(renderer);

// make sure it loads up to fill the window right
onResize();
}

var geometry;
Expand Down

0 comments on commit 143acb8

Please sign in to comment.