I created this in 2012 at HP Palm as part of a research in non conventional uses of tablets and pen. This prototype leverages a OptiTrack Motion Capture Systems and the code was written in C.
Patent application pending:
https://www.google.com/patents/US20130222381
̌