示例#1
0
        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);
        }
示例#2
0
        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));
        }
示例#3
0
        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);
        }
示例#4
0
        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);

        }
示例#5
0
        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);
        }
示例#6
0
        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));
        }