Example #1
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     camera = new Camera(this,new Vector3(0,25,15),new Vector3(0,25,0), Vector3.Up);
     Components.Add(camera);
     modelManger = new ModelManager(this);
     Components.Add(modelManger);
     base.Initialize();
 }
 public virtual void Draw(GraphicsDevice device,Camera camera)
 {
     Matrix[] transforms = new Matrix[model.Bones.Count];
     model.CopyAbsoluteBoneTransformsTo(transforms);
     foreach (ModelMesh mesh in model.Meshes)
     {
         foreach (BasicEffect effect in mesh.Effects)
         {
             effect.World = mesh.ParentBone.Transform*GetWorld();
             effect.View = camera.view;
             effect.Projection = camera.projection;
             effect.TextureEnabled = true;
         }
         mesh.Draw();
     }
 }
Example #3
0
 public override void Draw(GraphicsDevice device, Camera camera)
 {
     device.SamplerStates[0] = SamplerState.LinearWrap;
     base.Draw(device, camera);
 }
Example #4
0
 public override void Draw(GraphicsDevice device, Camera camera)
 {
     device.SamplerStates[0] = SamplerState.LinearClamp;
     skybox= Matrix.CreateScale(300f)* Matrix.CreateTranslation(camera.cameraPosition.X,0,camera.cameraPosition.Z);
     base.Draw(device, camera);
 }