Neat, clicking through the attributions, Headtrackr (https://github.com/auduno/headtrackr/) by auduno of Opera Software looks quite useful. That's in turn based on ccv (https://github.com/liuliu/ccv), which I knew about, but Headtrackr looks much nicer to use if you just want headtracking out of the box. It does some trigonometry, based on some assumptions about field of view, to provide the 3d coordinate estimates needed for demos like this, whereas ccv focuses on object identification/tracking within the 2d image (and is much more general, so more complex to use out of the box).
The Headtrackr guy also put up a demo of a game controlled using head movement: http://www.shinydemos.com/facekat/