Ejemplo n.º 1
0
        private void LoadTeapot()
        {
            var teapot = new GameModel(Content.Load <Model>("teapot"))
            {
                Position     = new Vector3(0, 0, 0),
                Scale        = new Vector3(50f),
                BaseRotation = new Vector3(0, MathHelper.Pi, 0),
                Rotation     = new Vector3(0, MathHelper.Pi, 0)
            };

            var local = effect.Clone();

            local.Parameters["LightColor"].SetValue(new Vector3(1, 0, 0));

            teapot.SetEffect(local);

            var component = new MoveableModel(this, teapot)
            {
                Left     = Keys.A,
                Right    = Keys.D,
                Forward  = Keys.W,
                Backward = Keys.S,
                Up       = Keys.R,
                Down     = Keys.F
            };

            Components.Add(component);
            Models.Add(teapot);
        }
Ejemplo n.º 2
0
        private void LoadTeapot()
        {
            var teapot = new GameModel(Content.Load<Model>("teapot"))
            {
                Position = new Vector3(0, 0, 0),
                Scale = new Vector3(50f),
                BaseRotation = new Vector3(0, MathHelper.Pi, 0),
                Rotation = new Vector3(0, MathHelper.Pi, 0)
            };

            var local = effect.Clone();
            local.Parameters["LightColor"].SetValue(new Vector3(1, 0, 0));

            teapot.SetEffect(local);

            var component = new MoveableModel(this, teapot)
            {
                Left = Keys.A,
                Right = Keys.D,
                Forward = Keys.W,
                Backward = Keys.S,
                Up = Keys.R,
                Down = Keys.F
            };

            Components.Add(component);
            Models.Add(teapot);
        }