Camera and Shadowed Lighting


There are 2 functions inside the XBase class that help you set your camera and shadowed light.
  • The camera is used to set the location of the camera and the point it looks towards.
  • The shadowed light is used to define the location of the light, the point it looks towards, intensity and ambient.
  • There is only one light in this engine that can produce a shadow.
  • Note : Use it only inside the Update Method, before updating any models.

usage :

 protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            XBase.UpdateCamera(new Vector3(-50, 50, -60), Vector3.Zero);
            XBase.UpdateLight(new Vector3(100, 75, -100), Vector3.Zero, 2.0f, 0.1f);
            model.UpdateModel(Matrix.CreateTranslation(0, 0, 0) * Matrix.CreateScale(.5f));
            base.Update(gameTime);
        }

Last edited Jan 3, 2010 at 3:14 PM by adityav89, version 3

Comments

No comments yet.