Jason (jcreed) wrote,

Tried doing some recreational software plumbing in the evening after work.

Node-webkit is a sort of best-of-both-worlds dealie between nodejs and the web-page-rendery parts of chrome: you get access to whatever nodejs modules you have lying around (which let you easily do arbitrary filesystem and network operations, e.g.) but you can also do uis like a webapp.

So logically you should be able to plumb together node-ovrsdk (a nodejs wrapper around the Oculus Rift sdk, which lets you get realtime orientation sensor readings) and threejs, a convenience library for webgl. I found some sample code that does exactly that.

Problem: For some reason I can only seem to get webgl on my linux box (with its sad, sad intel graphics card) working with more recent versions of chromium. Even when I use --ignore-gpu-blacklist! Well, no problem, I'll just use node-webkit version v0.11.0, which is based on Chromium 38.0.2125.104.

Problem: I can only seem to get node-ovrsdk to work on sufficiently old versions of nodejs. Because the ABI for C/C++-using native modules changed somewhere around nodejs v0.11. I tried actually looking at the C++ code that node-ovrsdk used to see if I could update it to the new ABI, but noped out of that pretty quickly. Well, no problem, I'll just use node-webkit version v0.8.6, which is based on nodejs v0.10.22.

Oh, that is a problem. Neither version of node-webkit completely works. Hm.

And that's when I decided to run one entirely separate copy of node v0.10.32 with the node-ovrsdk module, writing a JSON-ified quaternion representation of the Oculus Rift's current orientation every 10ms to a unix domain socket which is then read by node-webkit version v0.8.6 which successfully draws a slowly spinning 3d globe that reacts to my tilting head. VIRTUAL REALITYY~.
Tags: oculus

  • (no subject)

    Something that's bugged me for a long time is this: How many paths, starting at the origin, taking N steps either up, down, left or right, end up at…

  • (no subject)

    Didn't sleep well. Long day of work. Dinner with akiva at hanamichi.

  • (no subject)

    K was going to do a thing for her dad's birthday, but scheduling kept slipping and slipping so I guess we're going to try doing it tomorrow instead.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded