示例#1
0
        public override void render(float elapsedTime)
        {
            Device d3dDevice = GuiController.Instance.D3dDevice;


            TgcKinectSkeletonData data = tgcKinect.update();

            if (data.Active)
            {
                tgcKinect.DebugSkeleton.render(data.Current.KinectSkeleton);


                Vector3 headPos   = TgcKinectUtils.toVector3(data.Current.KinectSkeleton.Joints[JointType.Head].Position);
                Vector3 centerPos = TgcKinectUtils.toVector3(data.Current.KinectSkeleton.Joints[JointType.HipCenter].Position);
                float   length    = Vector3.Length(headPos - centerPos);
                BigLogger.log("Length", length);

                BigLogger.log("HipCenter", data.Current.CenterPos);
                BigLogger.log("RightHandPos", data.Current.RightHandPos);
                BigLogger.log("LefttHandPos", data.Current.LefttHandPos);
                BigLogger.renderLog();
            }


            GuiController.Instance.UserVars["tracking"] = data.Active.ToString();



            center.render();
            bounds.render();
        }
示例#2
0
        public override void render(float elapsedTime)
        {
            Device d3dDevice = GuiController.Instance.D3dDevice;

            //Velocidad de movimiento 2D
            tgcKinect.Hands2dSpeed = new Vector2((float)GuiController.Instance.Modifiers["speedX"], (float)GuiController.Instance.Modifiers["speedY"]);

            //Actualizar estado de kinect
            TgcKinectSkeletonData data = tgcKinect.update();

            if (data.Active)
            {
                //Render de esqueleto debug
                tgcKinect.DebugSkeleton.render(data.Current.KinectSkeleton);


                //Debug de pos de manos
                bool showValues = (bool)GuiController.Instance.Modifiers["showValues"];
                if (showValues)
                {
                    BigLogger.log("RightHandPos", data.Current.RightHandPos);
                    BigLogger.log("LefttHandPos", data.Current.LefttHandPos);
                    BigLogger.renderLog();
                }



                //Dibujar cursores
                rightHandPointer.Position = data.Current.RightHandPos;
                leftHandPointer.Position  = data.Current.LefttHandPos;
                GuiController.Instance.Drawer2D.beginDrawSprite();
                rightHandPointer.render();
                leftHandPointer.render();
                GuiController.Instance.Drawer2D.endDrawSprite();
            }


            //Dibujar limites de escena
            center.render();
            bounds.render();
        }