the Fiddler's picture

Introducing OpenTK.Rift: Oculus Rift bindings for OpenTK

It is my pleasure to introduce OpenTK.Rift, the first cross-platform C# wrapper for the Oculus Rift. The Oculus Rift is a next-generation virtual reality headset designed for immersive gaming.

Install via NuGet

OpenTK.Rift provides an intuitive C# API to read the properties of the device (orientation, acceleration, size, resolution) and control its parameters. Like OpenTK, you can use OpenTK.Rift with all .Net languages (C#, F#, VB.Net, ...) and on all desktop operating systems (Windows, Linux, Mac OS X.) Usage is extremely simple:

using System;
using OpenTK;
 
class Test
{
    public static void Main()
    {
        using (var oculus = new OculusRift())
        {
             Console.Writeline(oculus.Orientation);
        }
    }
}

You are welcome to join its development at https://github.com/opentk/rift!

Current status:

  • (done) Linux support
  • (done) Mac OS X support
  • (done) Console test
  • (done) OpenGL 1.x test
  • (done) Windows support
  • (done) Nuget support
  • (in progress) OpenGL 2.x test
  • (not started) OpenGL 3.x test

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ollhax's picture

Cool! :D

JTalton's picture

I see much lost time in my future. Now to just get hold of an Oculus Rift dev kit. Off to the virtual batcave!

the Fiddler's picture

Status update:

  • (done) Linux support
  • (done) Mac OS X support
  • (done) Windows support
  • (done) Nuget support
  • (done) Console test
  • (done) OpenGL 1.x test
  • (started) OpenGL 2.x test
  • (not started) OpenGL 3.x test
  • (not started) NuGet sample project

The code now works on all operating systems on .Net 4.0+ and Mono 2.8+. Travis-CI is testing every commit to make sure everything is working.

Building and generating nuget packages is now achieved with a single click. The only external depedency is CMake.

Using OpenTK.Rift is as simple as installing the NuGet package and typing:

using (var oculus = new OculusRift())
{
    Console.Writeline(oculus.Orientation);
}
JTalton's picture

Travis-Cl looks interesting, thanks for the heads up.

BTW: Just in case anyone has not checked it out, SourceTree is an awesome git/svn/mercurial client for Windows and Mac.

vicviper's picture

Hi, a very interesting project!

I've noticed you're using OculusOVR 2.5 , have you considered using the new 3.x SDK ?

the Fiddler's picture

Yes, I'll update as soon as the cross-platform version is released (or is it already?) The first 3.x release is/was windows-only IIRC.

vicviper's picture

3.0 sdk was a pre-release , they're on 3.1 already

the Fiddler's picture

From the release notes:

Quote:

Preview Release

Oculus SDK 0.3.1 is a Windows-only preview release intended to give developers early access to the upcoming improvements and APIs. The API presented is subject to change, and some new features (most notably DK2 position tracking support) are not included in this version. Mac and Linux support has also been omitted from this release only.

I will update the OpenTK.Rift packages as soon as a cross-platform version of the 3.x SDK is released. The new features are compelling, so I may release a preview before that.

Edit: pull-requests are always welcome.

vicviper's picture

I see, so 3.1 is still a pre.release

What I've read is that from 3.0, they completely changed the API from C++ back to C , to make easier develop bindings to other languages

the Fiddler's picture

In an interesting coincidence, the 3.2 SDK was released today, so I'll try to make a new release over the next few days.