Skip to content

kougaku/OculusRiftP5

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

OculusRiftP5

Oculus Rift Library for Processing

OculusRift_BasicExample

The library is currently distributed by PDE format (OculusRift.pde). First, see and run OculusRift_BasicExample.

Examples

OculusRift_BasicExample

This example shows simple scene that contains a wall, a floorboard, a cube, and stereo picture.

OculusRift_BasicExample


OculusRift_PanoramaView

It shows a spherical panorama view. The included picture was taken by RICOH THETA.

OculusRift_PanoramaView


OculusRift_RadarExample

It shows a radar denoting user's head direction.

OculusRift_RadarExample


OculusRift_VideoSeeThrough

This is an example for making augmented reality. You need web camera for running it. This code uses sarxos's webcam-capture library instead of Processing's Capture class, because jna.jar used by Processing's Capture class conflicts with jna-4.1.0.jar used in OculusRift.pde.

OculusRift_VideoSeeThrough


Environment

It was checked that it worked in the following environment.

  • Oculus Rift DK2 (currently only for DK2)
  • Oculus Runtime V0.5.0.1-beta
  • Processing 2.2.1
  • Windows 8.1 and OS X Yosemite (v10.10.2)


How to use

Skeleton

OculusRift oculus;

void setup() {
  size( 1920, 1080, P3D );
  oculus = new OculusRift(this);
  oculus.enableHeadTracking();
}

void draw() {
  oculus.draw();
}

// Scene for OculusRift
void onDrawScene(int eye) {

}

Please make the function named "onDrawScene(int eye)" and write a code about 3D scene in it. In the function, the scale is approximately real scale and the unit is a millimeter. The default eye position is on the origin (0, 0, 0) in the scene. The parameter "eye" gives LEFT or RIGHT.

API

Method Description
boolean enableHeadTracking(); Enables head tracking.
void draw(); Draws a stereo image for Oculus Rift display.
void resetHeadState(); Resets the head state matrix by current state.
PMatrix3D getMatrix(); Gets the current head state matrix.

Acknowledgements

Thanks a lot for the following codes.

About

Oculus Rift Library for Processing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published