Example #1
0
 public Light(Game game, Lamp lamp, RotationAxis rotationAxis, Vector3 position)
     : base(game)
 {
     this.lamp = lamp;
     this.rotationAxis = rotationAxis;
     Power = true;
     DiffuseLightPower = defaultDiffuseLightPower;
     SpecularLightPower = defaultSpecualarLightPower;
     Position = position;
     LookAt = new Vector3(0.01f, 0.0f, 0.0f);
     CutOffAngle = defaultCutOffAngle;
     SpotLight = false;
     SelfShading = true;
     upVector = Vector3.Up;
     Rotate = false;
     AttenuationDistance = defaultLightAttenuationDistance;
     direction = 1.0f;
 }
Example #2
0
 private void SetupLights()
 {
     Vector3 position = new Vector3(0.0f, 14.5f, 0.0f);
     Lamp lamp = new Lamp(this, Matrix.CreateRotationX(MathHelper.ToRadians(-90)) * Matrix.CreateTranslation(position));
     Light = new Light(this, lamp, Light.RotationAxis.X, position);
     Components.Add(lamp);
     Components.Add(Light);
 }