A simple desktop app and javaScript library to link the Oculus Rift with the web.
Important Bits:
- Host App: Windows | Mac OSX
- JS library
- Documentation
The goal of this project is to provide a flexible, simple way to access the tracking data and display configuration for the Oculus Rift for use with webGL or any other browser-based content. This is not the first websocket based utility for the Oculus Rift, but the cross platform code base and modularity of the JavaScript has been built to support changes in the hardware and ease of integration on the JavaScript side.
- An Oculus Rift
- A browser that supports websockets
- The OculusBrige host application : Windows | Mac OSX
- Download and launch the OculusBrige host application
- Open one of the example pages:
- Plug in your Oculus Rift (you probably already did this already..)
The order in which these things occur isn't important. The app and JavaScript are built to handle loosing connectivity, having the hardware connected and disconnected randomly at runtime, etc.
The JavaScript library has been tested with the following browsers:
- Chrome 28
- Safari 6
- Firefox 22
Example content is currently using THREE.js r59
The bridge application has been compiled for MacOS Mountain Lion and Windows 7.
To add Oculus Rift support to your web project, download and include OculusBridge.min.js in your HTML. The bridge is purely a way to access data from the rift hardware and does not make any assumptions about the renderer. It is especially easy to use the bridge with THREE.js but there is no specific dependancy on THREE.js at this time. Check out the documentation and example code for more detailed explaination.
// rotate a THREE.js object based on the orientation of the Oculus Rift
var bridge = new OculusBridge({
"onOrientationUpdate" : function(quatValues) {
giantSquid.quaternion.set(quatValues.x, quatValues.y, quatValues.z, quatValues.w);
}
});
bridge.connect();
Thanks to the following libraries and people who make this project possible. Credit and copyright belong to the respective parties:
- Cinder - license
- Websocket++ - license
- Websocket++ Cinder Block
- THREE.js - license
- RiftCamera for THREE.js
- Oculus Rift SDK