Ejemplo n.º 1
0
        private void BuildFinalObject()
        {
            var done         = new List <bool>(new bool[11]);
            var tmpFinalPath = tmpPath + "/tmp.ply";

            File.Copy(tmpPath + "/proto.ply", tmpFinalPath);
            while (done.Count(x => x) < steps)
            {
                var stdone = false;
                for (var i = 0; i < crtStep; i++)
                {
                    if (done[i] || !rotatedParts[i])
                    {
                        continue;
                    }

                    Kinect.CombineObjects(tmpFinalPath, tmpPath + "/part-" + i + "-rotated.ply", tmpFinalPath);
                    done[i] = true;
                    stdone  = true;
                }
                if (!stdone)
                {
                    Thread.Sleep(1000);

                    Console.WriteLine("Waiting for object parts to be rotated");
                }
                if (killed)
                {
                    return;
                }
            }
            resultPath = tmpPath + "/result.ply";
            File.Move(tmpFinalPath, resultPath);
            Console.WriteLine("Final object build: '" + resultPath + "'.");
            Console.WriteLine("type 'open result' to open it");
        }
Ejemplo n.º 2
0
        private void Window_Loaded(object sender, EventArgs e)
        {
            m_KinectDevice = Kinect.Instance;
            m_KinectDevice.GuaranteeInitialized();

            m_KinectDevice.VoiceCommand.ActionFired += OnVoiceCommand;
            lastTime = DateTime.Now;

            m_KinectDevice.Nui.DepthFrameReady += new EventHandler<ImageFrameReadyEventArgs>(nui_DepthFrameReady);
            m_KinectDevice.Nui.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);
            m_KinectDevice.Nui.VideoFrameReady += new EventHandler<ImageFrameReadyEventArgs>(nui_ColorFrameReady);
        }