entity class that holds the skeleton Frame joints data from kinect sensor stream.
        //Runtime nui;
        public Kinect()
        {
            skeleton = new skeleton(0);

            //getting first kinect
            foreach (KinectSensor sensor in KinectSensor.KinectSensors)
            {
                if (sensor.Status == KinectStatus.Connected)
                {
                    kinectSensor = sensor;
                    break;
                }
            }

            if (kinectSensor == null)
                return;

            Console.WriteLine(kinectSensor.Status);

            //starting kinect and enabling skeleton data stream
            kinectSensor.Start();
            kinectSensor.SkeletonStream.Enable();

            //register event handler on skeleton fram ready event
            kinectSensor.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(skeletonFrameReady);
        }
Beispiel #2
0
        public Kinect()
        {
            skeleton = new skeleton(0);

            //getting first kinect
            foreach (KinectSensor sensor in KinectSensor.KinectSensors)
            {
                if (sensor.Status == KinectStatus.Connected)
                {
                    kinectSensor = sensor;
                    break;
                }
            }

            if (kinectSensor == null)
            {
                return;
            }

            Console.WriteLine(kinectSensor.Status);

            //starting kinect and enabling skeleton data stream
            kinectSensor.Start();
            kinectSensor.SkeletonStream.Enable();

            //register event handler on skeleton fram ready event
            kinectSensor.SkeletonFrameReady += new EventHandler <SkeletonFrameReadyEventArgs>(skeletonFrameReady);
        }