Slides
Here is my presentation from Stage3D online conferenceQuick Note about my speech
It consists from 4 parts:- quick review of LeapMotion device - not technical
- work with Raw data from WebSocket
- work with LeapMotionAS3 API
- Drag-n-Drop demos
Intro
I started my speech with quick overview of LeapMotion capabilities. It's very similar to my post All About LeapMotion.Raw data from Socket
It's never been so easy to track data from any device. Just plug to WebSocket and get raw data.Javascript
Flash
Because Adobe Flash doesn't have WebSockets we need to emulate it.
WebSocket fix recipe:
- Connect to Socket 'localhost:6437'
- Send WebSocket handshake
- Get WebSocket handshake
- Track data from socket
Here is example
Socket policy files / Cross domain
The big difference between Sockets in Flash and JS is that Flash Sockets require special CrossDomain.xml file on server side. Without it you will get an error:onSecurityErrorHandler Error #2048: Security sandbox violation:Victor Norgren informed LeapMotion team about this issue but still haven't received any response. Maybe them will fix it in upcoming driver versions. But we don't have any confidence.
Fix it
But we can fix it.Cross domain fix recipe:
- Don't use Flash for Socket communication
- Connect to Socket in JS
- Handle onmesssage
- Use ExternalInterface.addCallback to pass data from js to flash
PS
In upcoming part I'll show you how to use LeapMotionAs3 library from Victor Norgren and Wouter Verweirder to create 3D Controller for drag'n'drop 3D object.PPS
I plan to do more presentations on LeapMotion interaction so If you have any questions about it or you're interested in some topics - just write down here in the comments section and I'll try to address them in the upcoming speeches.Thanks, See you guys!
survey service
No comments :
Post a Comment