The Spider: Using SteamVR dev kit for creating a glasses tracker.

August 30 | 17

In the lab, I have been working for some time with a SteamVR tracking dev kit we got. I started a small project of creating trackable shutter glasses so we can use on our VR experiments. I have been trying to write about this for a while but finally I could find some time todo this!

On this post I’m going to write about how we created in the lab a trackable prototype frame that uses SteamVR that gets attached to our shutter glasses for our projects here at the EAC. If you are more interested on how we did this / more details on the whole workflow for doing just to write me an email and I will try to explain with more detail.

Steam VR Overview

The Steam VR tracking system is a system based on timing, the wireless connection uses a proprietary protocol and the only difference between a controller and a HMD is that the HMD has a display, besides that, the way it works is exactly the same.

The system uses 2 bases stations to track objects. These basestations are called “lighthouses” and need to be synchronized either by wire or by flashes (if the lighthouses are in the field of view from each other).

These lighthouses contain 2 motors that spin at 60Hz (one Horizontal and one Vertical), they produce IR signals modulated at 1.8Mhz generating time stamps at 48Mhz. The difference between the synch flash from the light houses and a laser hit on the tracked object sensors generates an angle. These angles plus some precisely timing produce an equation system that provides the position and rotation of the tracked object.

Each tracked object contains a set of optical receivers; these optical receivers detect reference signals from the base stations and with a photo diode, they convert IR light to a signal that the FPGA in the tracked object understands as a hit.

The FPGA then uses ticks to calculate angles between laser hits from the basestations plus the known position of each sensor to generate the equation system that solves the position and rotation of the tracked object.


In order to design the spider we had to take into account several factors. The tracked object  had to be light, it shouldn’t occlude the view from the glasses it was going to be attached to and the sensor placement should be positioned taking into account translation and rotation errors that can arise.

Translation errors: These type of errors arise when the tracked object is being moved around the tracked area. As the distance from the lighthouse increases, the tangential velocity from the spinning motors in the base stations also increases hence decreasing the time between sensor hits. Then the error begins to dominate, in order to avoid this type of error the sensors should be as far apart as possible.

Rotational errors: These errors arise when the user is rotating the tracked object. Rotation of sensors orthogonal to a plane yields significant displacement while rotation in a plane yields less displacement, in order to avoid this type of errors sensors should be out of plane.

In order to achieve these requirements, we decided to 3D print a structure that “hooks” itself to a set of shutter glasses taking into account the limitations on sensor placement we mentioned above. After 3 iterations, we came up with a final prototype that complies with all the aforementioned requirements.


After designing the frame with all the specific positions of each sensor we ran our generated model through a simulator that the SteamVR provides that assesses how good or bad tracking the proposed model has.

This simulator offers two type of views; a 3D view looking from the lighthouse and a 2D unwrapped view

Each view shows a translation error, a rotation error, an initial pose view and the number of sensors that are possible to view from a specific view. Also, each view shows colors that go from blue (good tracking) to red (tracking not possible) and in our case, we only need to track the front of the glasses (as is where the user is looking at in the projection screen).

As one can see in the 3D figures the front of our tracked object both for rotational errors and translation errors shows good results.

Physical Prototype Results

After 3D printing the different parts, positioning and calibrating the sensors and the IMU (gyroscope) for the tracked object, we gave it a few tests and so far it works promisingly.

Finally  a small video that shows the spider in action. I can definitely say that I look like a cyborg 🙂

Where’s my daughter?! Our Entry for the Global Game Jam 2016

February 3 | 16

For those of you who dont know, the global game jam ( is a hackaton where the purpose is to develop a game given a topic.

This year, my Colombian friends from Indie Level and I came up with an idea of a puzzle where the main goal is to sneak into a castle and get to the princess room, hypnotize her and take her back to the starting point. We where inspired in Monument Valley to create this game.

Without further ado, here’s a video on how the game ended up looking after 48 hours. this was made by 2 artists and 2 programmers.

We plan to release the game for Mobile devices with 10 levels initially but no release date yet. if you like it, let me know 🙂



Forcing OpenGL on Unity5.x on windows Builds

November 3 | 15

So in the lab we needed to run our builds in windows in OpenGL so based on the docs you just add a “-force-opengl” flag when starting the app and you should be good to go.

But we where getting a pink screen all over the place (symptoms of unrecognized shaders). After fighting with it for a while I asked Aras and turns out that since Unity 5.1 OpenGL shaders are not included into windows builds by default.

So to make this work, just go to Editor->Project Settings -> Player and uncheck “Automatic graphics API” and add GL in the player settings and you should be good to go.



Making particles follow a path

September 7 | 15

So I was tasked to make a particle system follow a set of points (P1, P2, P3, … Pn) for a visualization in the CAVE. Basically given a particle system, make the particles in it follow a set of points:












If we linearly interpolate their positions through a group of points we will get a set of particles that will follow a set of points, something like this:












Instead what we want is to make each spawned particle follow a set of directions, something like this:












So in order to achieve this, we create an array of directions (given the points), then we check the total distance traveled for each particle and then depending on where the particle is located (across the points) we change the direction accordingly towards the next point (when it reaches each point)

The end result:

The Code:

The code is pretty straight forward; one editor script and one simple script that needs to be attached to a game object that contains the particle system.

Editor Script: (remember to place it under “Editor” folder).

 The script:

Still there is some stuff missing like adding speed to the particles or making the generated pivots move relative to the game object but it pretty much does the job.



How to know if a point is inside a polygon

April 16 | 15

Here’s a quick code snippet to know if given a point, the point is inside an array of polygon vertices. Based on the crossing number algorithm.


This can also be extended to 3D space if necessary, but that’s for the reader.