Exemplo n.º 1
0
        void handsGenerator_HandDestroy(object sender, HandDestroyEventArgs e)
        {
            NiteKinectHandGestureEventData eventdata = new NiteKinectHandGestureEventData(new NiteKinectHandGestureData(e.UserID, NiteKinectHandState.Destroyed, new Point3D()));

            if (DataReceived != null)
            {
                DataReceived(this, new DataReceivedEventHandler()
                {
                    PluginData = eventdata
                });
            }
        }
Exemplo n.º 2
0
        void handsGenerator_HandCreate(object sender, HandCreateEventArgs e)
        {
            NiteKinectHandGestureEventData eventdata = new NiteKinectHandGestureEventData(new NiteKinectHandGestureData(e.UserID, NiteKinectHandState.Created, this.depth.ConvertRealWorldToProjective(e.Position)));

            if (DataReceived != null)
            {
                DataReceived(this, new DataReceivedEventHandler()
                {
                    PluginData = eventdata
                });
            }
        }
Exemplo n.º 3
0
        void gestureGenerator_GestureRecognized(object sender, GestureRecognizedEventArgs e)
        {
            NiteKinectHandGestureEventData eventdata;

            switch (e.Gesture.ToLower())
            {
            case "wave":
                handsGenerator.StartTracking(e.IdentifiedPosition);
                break;

            case "click":
                eventdata = new NiteKinectHandGestureEventData(new NiteKinectHandGestureData(0, NiteKinectHandState.GestureClick, this.depth.ConvertRealWorldToProjective(e.EndPosition)));
                if (DataReceived != null)
                {
                    DataReceived(this, new DataReceivedEventHandler()
                    {
                        PluginData = eventdata
                    });
                }
                break;

            case "raisehand":
                eventdata = new NiteKinectHandGestureEventData(new NiteKinectHandGestureData(0, NiteKinectHandState.GestureRaiseHand, this.depth.ConvertRealWorldToProjective(e.EndPosition)));
                if (DataReceived != null)
                {
                    DataReceived(this, new DataReceivedEventHandler()
                    {
                        PluginData = eventdata
                    });
                }
                break;

            default:
                break;
            }
        }