We are building a smart mirror (2 way mirror with a TV behind it) that you can draw on. It's working well, but we are hoping to make it awesome. The leap is sitting 5" away from the screen and we are using the pointable.tipPosition to get the finger position. The "app" is a simple html/js canvas page running fullscreen in chrome on OSX. The Leap position is translated into onscreen coordinates by first calibrating the bounds of the drawable area. We point at the bottom, top, left, right and then do the math.
It's working good. But while drawing about 1% of the position data comes in at a location not close to the finger tip. It makes the drawing look bad and is frustrating for the user. There does seem to be a correlation between sunlight and the amount of bad points received. We will have control over the environment where it's being installed so no sunlight will be present.
We've looked into plastics that allow IR through but block UV and other light spectrums. Is this helpful to place over the leap?
This is an abreviated look at the code:
var controller = new Leap.Controller();
controller.on('frame', function(frame){
var tipPosition = pointable.tipPosition;
var screenWidth = hotarea.right - hotarea.left;
var deltaHor = ( tipPosition[0] > 0 ) ? tipPosition[0] + Math.abs( hotarea.left ) : Math.abs( hotarea.left - tipPosition[0] );
var posHor = ( 1920 - 1080 ) / 2 + deltaHor / screenWidth * 1080;
var screenHeight = hotarea.top - hotarea.bottom;
var posVer = (hotarea.top - tipPosition[1]) * 1080 / screenHeight;
});
Any advise would be welcome.