Пример #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);


            spaceship = new GameModel(Content.Load <Model>("spaceship"))
            {
                Position = new Vector3(0, 400, -1000),
                Scale    = new Vector3(50f),
            };

            var list = new ModelAnimationKeyframeList(spaceship.Position, spaceship.Rotation)
                       .Translate(dz: 1600)
                       .Rotate(dy: MathHelper.PiOver2)
                       .Translate(dx: 1600)
                       .Rotate(dy: MathHelper.PiOver2)
                       .Translate(dz: -1600)
                       .Rotate(dy: MathHelper.PiOver2)
                       .Translate(dx: -1600)
                       .Rotate(dy: MathHelper.PiOver2);

            animation = new KeyframedModelAnimation(
                list, true, false);

            models.Add(spaceship);
            models.Add(Content.Load <Model>("ground"));

            var d = 2000;

            camera = new FixedCamera(
                new Vector3(-d, d, -d),
                Vector3.Zero,
                GraphicsDevice);
        }
Пример #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            spaceship = new GameModel(Content.Load<Model>("spaceship"))
            {
                Position = new Vector3(0, 400, -1000),
                Scale = new Vector3(50f),
            };

            var list = new ModelAnimationKeyframeList(spaceship.Position, spaceship.Rotation)
                    .Translate(dz: 1600)
                    .Rotate(dy: MathHelper.PiOver2)
                    .Translate(dx: 1600)
                    .Rotate(dy: MathHelper.PiOver2)
                    .Translate(dz: -1600)
                    .Rotate(dy: MathHelper.PiOver2)
                    .Translate(dx: -1600)
                    .Rotate(dy: MathHelper.PiOver2);

            animation = new KeyframedModelAnimation(
                list, true, false);

            models.Add(spaceship);
            models.Add(Content.Load<Model>("ground"));

            var d = 2000;
            camera = new FixedCamera(
                new Vector3(-d, d, -d),
                Vector3.Zero,
                GraphicsDevice);
        }
Пример #3
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);


            spaceship = new GameModel(Content.Load <Model>("spaceship"))
            {
                Position = new Vector3(0, 400, -1000),
                Scale    = new Vector3(50f),
            };

            animation = new ModelAnimation(
                spaceship.Position,
                Vector3.Zero,
                spaceship.Position + new Vector3(0, 0, 2600),
                new Vector3(0, MathHelper.Pi, 0),
                TimeSpan.FromSeconds(5),
                true,
                true
                );

            models.Add(spaceship);
            models.Add(Content.Load <Model>("ground"));

            var d = 2000;

            camera = new FixedCamera(
                new Vector3(-d, d, -d),
                Vector3.Zero,
                GraphicsDevice);
        }