Skip to content

Instantly share code, notes, and snippets.

@nairol
nairol / oculus_led_ecc.c
Last active March 19, 2019 08:59
Oculus Rift DK2 IR-LED ECC Generator Algorithm
/*
** This is the algorithm that generates the error correction code (ECC) used to identify each IR-LED in
** the Oculus Rift DK2.
** More information on the DK2 optical tracking system can be found in the blog post series
** "Hacking the Oculus Rift DK2" by Oliver Kreylos: http://doc-ok.org/?p=1095
**
** This algorithm was *not* found in the binaries provided by Oculus (they only include pre-computed LUTs).
**
** The algorithm is pretty simple:
** All code words need to fulfil two requirements: