Esempio n. 1
0
 protected override void Initialize()
 {
     Window.Title = "3D Project";
     //IsMouseVisible = true;
     graphics.PreferredBackBufferWidth = 1280;
     graphics.PreferredBackBufferHeight = 1024;
     graphics.ApplyChanges();
     land = new Ground("x6");
     camera = new Camera();
     dome = new Sky();
     trees = new Forest();
     this.Components.Add(new FrameRateCounter(this));
     this.Components.Add(new ShowFPS(this));
     base.Initialize();
 }
Esempio n. 2
0
 public void MapMirror(Camera camera, Sky sky)
 {
     camera.Reflecting = true;
     Plane reflectionPlane = CreatePlane(waterHeight - 0.5f, Vector3.Down, camera, true);
     camera.SetParam("ClipPlane0", new Vector4(reflectionPlane.Normal, reflectionPlane.D));
     camera.SetParam("Clipping", true);
     camera.SetTarget(reflectionT);
     camera.device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer | ClearOptions.Stencil, Color.SteelBlue, 1.0f, 0);
     sky.DrawClouds(camera);
     DrawGround(camera, true);
     camera.SetParam("Clipping", false);
     camera.RevertTarget();
     reflectionMap = reflectionT;
 }