Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
38leinaD's avatar
38leinaD
Honored Guest
13 years ago

Java Wrapper. First Version!

Hi There,
As a first note: I don't have my rift yet, so I have been writing this Java wrapper for the OR blindly. I would be cool if someone with a Rift and interest in Java could test it out:
https://dl.dropbox.com/u/8241387/OVR/JRift_alpha.zip

It is compiled for a 32-bit Java Runtime. And you can just call the contained JRift.bat to make it start a loop to read from the Rift sensors:

OculusRift or = new OculusRift();
or.init();

HMDInfo hmdInfo = or.getHMDInfo();
System.out.println(hmdInfo);

while (or.isInitialized()) {
or.poll();

System.out.println("Yaw: " + or.getYaw() + " Pitch: " + or.getPitch() + " Roll: " + or.getRoll());

try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}

or.destroy();


Any comment is welcome.

Cheers,
Daniel

43 Replies