Пример #1
0
        public Avatar(Game game, RetargetMatrixHierarchyToAvatarMesh retarget, Vector3 skeletonTranslationScaleFactor)
            : base(game)
        {
            if (null == game)
            {
                return;
            }
            this.SkeletonTranslationScaleFactor = skeletonTranslationScaleFactor;

            label3 = new Label(game, new Vector2(5.0f, 65.0f));
            Game.Components.Add(label3);

            this.retargetMethod = retarget;
            this.SkeletonDrawn = true;
            this.useKinectAvateering = true;

            this.jointPositionFilter = new Kandou_v1.Filters.SkeletonJointsPositionDoubleExponentialFilter();
            this.boneOrientationFilter = new Kandou_v1.Filters.BoneOrientationDoubleExponentialFilter();

            this.mirrorView = true;

            var jointPositionSmoothParameters = new TransformSmoothParameters
            {
                Smoothing = 0.25f,
                Correction = 0.25f,
                Prediction = 0.75f,
                JitterRadius = 0.1f,
                MaxDeviationRadius = 0.04f
            };

            this.jointPositionFilter.Init(jointPositionSmoothParameters);

            var boneOrientationSmoothparameters = new TransformSmoothParameters
            {
                Smoothing = 0.5f,
                Correction = 0.8f,
                Prediction = 0.75f,
                JitterRadius = 0.1f,
                MaxDeviationRadius = 0.1f
            };

            this.boneOrientationFilter.Init(boneOrientationSmoothparameters);
        }
        public KinectSkinnedModelAnimation(Game game)
            : base(game)
        {
            this.chooser = new Kinect(Game, ColorImageFormat.RgbResolution640x480Fps30, DepthImageFormat.Resolution320x240Fps30);
            Game.Services.AddService(typeof(Kinect), this.chooser);
            Game.Components.Add(this.chooser);

            this.animator = new Avatar(Game, this.RetargetMatrixHierarchyToAvatarMesh, SkeletonTranslationScaleFactor);
            Game.Components.Add(this.animator);

            //
            this.skeletonDetected = false;
            this.avatarHipCenterDrawHeight = 0.76f; //65
            //

            this.label2 = new Label(Game, new Vector2(5.0f, 25.0f));
            Game.Components.Add(this.label2);

            this.label3 = new Label(Game, new Vector2(5.0f, 45.0f));
            Game.Components.Add(this.label3);
        }
Пример #3
0
        public Game1()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            this.graphics.PreparingDeviceSettings += this.GraphicsDevicePreparingDeviceSettings;

            Content.RootDirectory = "Content";

            this.Window.Title = "Avatar-Kinect [TEST]";

            // COMPONENTS
            this.kinectAvatar = new KinectSkinnedModelAnimation(this);
            this.Components.Add(this.kinectAvatar);

            fps = new fpsCounter();

            this.graphics.SynchronizeWithVerticalRetrace = false;
            this.graphics.ApplyChanges();
            //this.IsFixedTimeStep = false;

            label1 = new Label(this, new Vector2(5.0f, 5.0f));
            this.Components.Add(this.label1);
        }