Beispiel #1
0
        public CompressionSample(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            var modelNode = ContentManager.Load <ModelNode>("Dude/Dude");

            SampleHelper.EnablePerPixelLighting(modelNode);

            _meshNodeUncompressed           = modelNode.GetSubtree().OfType <MeshNode>().First().Clone();
            _meshNodeUncompressed.PoseLocal = new Pose(new Vector3F(-0.5f, 0, 0), Matrix33F.CreateRotationY(ConstantsF.Pi));
            GraphicsScreen.Scene.Children.Add(_meshNodeUncompressed);

            _meshNodeCompressed           = _meshNodeUncompressed.Clone();
            _meshNodeCompressed.PoseLocal = new Pose(new Vector3F(0.5f, 0, 0), Matrix33F.CreateRotationY(ConstantsF.Pi));
            GraphicsScreen.Scene.Children.Add(_meshNodeCompressed);

            Dictionary <string, SkeletonKeyFrameAnimation> animations = _meshNodeUncompressed.Mesh.Animations;

            _animation = animations.Values.First();

            RestartAnimations();
        }