Esempio n. 1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            spaceship = new GameModel(Content.Load<Model>("spaceship"))
            {
                Position = new Vector3(0, 400, 0),
                Scale = new Vector3(50f),
                BaseRotation = new Vector3(0, MathHelper.Pi, 0)
            }
            .SetEffect(Content.Load<Effect>("TextureMapper"));

            models.Add(spaceship);

            var ground = new GameModel(Content.Load<Model>("ground"))
                .SetEffect(Content.Load<Effect>("TextureMapper"));

            models.Add(ground);

            camera = new ChaseCamera(
                new Vector3(0, 400, 1500),
                new Vector3(0, 200, 0),
                new Vector3(0, 0, 0),
                GraphicsDevice);
        }
Esempio n. 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);
        }
Esempio n. 3
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            var pointLightEffect = Content.Load<Effect>("PointLightEffect");
            pointLightEffect.Parameters["LightColor"].SetValue(new Vector3(1f, 1f, 0.5f));

            spaceship = new GameModel(Content.Load<Model>("spaceship"))
            {
                Position = new Vector3(0, 400, 2600),
                Scale = new Vector3(50f),
                BaseRotation = new Vector3(0, MathHelper.Pi, 0)
            }
            .SetEffect(pointLightEffect);

            models.Add(spaceship);

            var ground = new GameModel(Content.Load<Model>("ground"))
                .SetEffect(pointLightEffect, allowSpecular: false);

            models.Add(ground);

            camera = new ChaseCamera(
                new Vector3(0, 400, 1500),
                new Vector3(0, 200, 0),
                new Vector3(0, 0, 0),
                GraphicsDevice);
        }
Esempio n. 4
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            ground = Content.Load<Model>("ground");
            this.CreateBillboardSystem();

            camera = new FreeCamera(new Vector3(0, 700, 3000),
                MathHelper.ToRadians(0),
                MathHelper.ToRadians(5),
                GraphicsDevice);
        }