public GameScene(RenderSystem rs) { renderSys = rs; Viewport vp = rs.Viewport; float aspectRatio = vp.Width / (float)vp.Height; camera = new RtsCamera(42.5f, aspectRatio); SceneRendererParameter sm = new SceneRendererParameter(); sm.SceneManager = new OctplSceneManager(PlanetEarth.PlanetRadius); sm.UseShadow = true; sm.PostRenderer = new GamePostRenderer(renderSys, camera); renderer = new SceneRenderer(renderSys, sm); renderer.ClearColor = ColorValue.White; camera.NearPlane = 20; camera.FarPlane = 6000; camera.Mode = RenderMode.Final; camera.RenderTarget = renderSys.GetRenderTarget(0); renderer.RegisterCamera(camera); PlanetEarth earth = new PlanetEarth(renderSys); sm.SceneManager.AddObjectToScene(earth); OceanWater water = new OceanWater(renderSys); sm.SceneManager.AddObjectToScene(water); //Atmosphere atmos = new Atmosphere(renderSys); //sm.SceneManager.AddObjectToScene(atmos); }
public void Load() { Size clSize = Program.Window.ClientSize; camera = new ChaseCamera(clSize.Width / (float)clSize.Height); camera.ChaseDirection = new Vector3(0, 0, 1); camera.ChasePosition = new Vector3(0, 0, 0); camera.DesiredPositionOffset = new Vector3(0, 0, 40); camera.Mode = RenderMode.Final; camera.FarPlane = 10000; camera.NearPlane = 10f; camera.RenderTarget = renderSys.GetRenderTarget(0); distance = 40; yang = MathEx.Degree2Radian(30); xang = MathEx.Degree2Radian(45); sceneManager = new SceneManager(); SceneRendererParameter sm = new SceneRendererParameter(); sm.PostRenderer = new DefaultPostRenderer(); sm.SceneManager = sceneManager; sm.UseShadow = false; renderer = new SceneRenderer(renderSys, sm); renderer.RegisterCamera(camera); obj = new ModelWrapper(); sceneManager.AddObjectToScene(obj); //ModelData mdlData = PathBuilder.BuildModel(renderSys, null, new Point[] //{ // new Point(0,0), new Point(2,1), new Point(4,4), new Point(5,4), new Point(6,5), new Point(6,7), new Point(9,9) //}); //CurrentModel = new Model(new ResourceHandle<ModelData>(mdlData, true)); }
public void Load() { Size clSize = Program.Window.ClientSize; camera = new ChaseCamera(clSize.Width / (float)clSize.Height); camera.ChaseDirection = new Vector3(0, 0, 1); camera.ChasePosition = new Vector3(0, 0, 0); camera.DesiredPositionOffset = new Vector3(0, 0, 40); camera.Mode = RenderMode.Final; camera.FarPlane = 1000; camera.NearPlane = 0.5f; camera.RenderTarget = renderSys.GetRenderTarget(0); distance = 40; yang = MathEx.Degree2Radian(30); xang = MathEx.Degree2Radian(45); sceneManager = new SceneManager(); SceneRendererParameter sm = new SceneRendererParameter(); sm.PostRenderer = new DefaultPostRenderer(); sm.SceneManager = sceneManager; sm.UseShadow = false; renderer = new SceneRenderer(renderSys, sm); renderer.RegisterCamera(camera); peff = new SmokeEffect(renderSys); peff.Emitter = new ParticleEmitter(1); peff.Modifier = new ParticleModifier(); sceneManager.AddObjectToScene(peff); }
public void Load() { Size clSize = Program.Window.ClientSize; camera = new ChaseCamera(clSize.Width / (float)clSize.Height); camera.ChaseDirection = new Vector3(0, 0, 1); camera.ChasePosition = new Vector3(0, 0, 0); camera.DesiredPositionOffset = new Vector3(0, 0, 40); camera.Mode = RenderMode.Final; camera.FarPlane = 1000; camera.NearPlane = 0.5f; camera.RenderTarget = renderSys.GetRenderTarget(0); distance = 40; yang = MathEx.Degree2Radian(30); xang = MathEx.Degree2Radian(45); sceneManager = new SceneManager(); SceneRendererParameter sm = new SceneRendererParameter (); sm.PostRenderer = new DefaultPostRenderer(); sm.SceneManager = sceneManager; sm.UseShadow = false; renderer = new SceneRenderer(renderSys, sm); renderer.RegisterCamera(camera); peff = new SmokeEffect(renderSys); peff.Emitter = new ParticleEmitter(1); peff.Modifier = new ParticleModifier(); sceneManager.AddObjectToScene(peff); }