Exemplo n.º 1
0
        public override void Init()
        {
            Content.ContentPath = "Data";
            Instance            = this;

            scene        = new Scene();
            scene.View   = this;
            scene.Camera = new LookatCartesianCamera()
            {
                Position    = new Vector3(10, 10, 10),
                Lookat      = Vector3.Zero,
                ZFar        = 100,
                AspectRatio = AspectRatio
            };
            sceneQuadtree = new Common.Quadtree <Entity>(0, 0, 100, 100, 10);
            sbau          = new SceneBVHAutoSyncer(scene, sceneQuadtree);
            //heightmap = TextureUtil.ToHeightmap(Content.Peek<Texture>(new TextureFromFile("testheightmap.png")), 100);
            heightmap = new Graphics.Software.Texel.R32F[250, 250];
            texture   = new Graphics.Software.Texture <Graphics.Software.Texel.R32F>(heightmap);

            renderer = new Graphics.Renderer.Renderer(Device9)
            {
                Scene = scene, StateManager = new Device9StateManager(Device9)
            };
            renderer.Settings.ShadowQuality = Settings.ShadowQualities.NoShadows;
            renderer.Initialize(this);

            sceneRendererConnector = new SortedTestSceneRendererConnector
            {
                Renderer = renderer,
                Scene    = scene
            };
            sceneRendererConnector.Initialize();

            scene.Add(ground = new TestGround
            {
                Size      = new SizeF(100, 100),
                Heightmap = heightmap,
                NPieces   = new Size(20, 20),
                Height    = 1
            });
            ground.ConstructPieces();

            InputHandler = new WalkaroundCameraInputHandler
            {
                Camera = (LookatCartesianCamera)scene.Camera
            };
        }
Exemplo n.º 2
0
        public override void Init()
        {
            Content.ContentPath = "Data";
            Instance = this;

            scene = new Scene();
            scene.View = this;
            scene.Camera = new LookatCartesianCamera()
            {
                Position = new Vector3(10, 10, 10),
                Lookat = Vector3.Zero,
                ZFar = 100,
                AspectRatio = AspectRatio
            };
            sceneQuadtree = new Common.Quadtree<Entity>(0, 0, 100, 100, 10);
            sbau = new SceneBVHAutoSyncer(scene, sceneQuadtree);
            //heightmap = TextureUtil.ToHeightmap(Content.Peek<Texture>(new TextureFromFile("testheightmap.png")), 100);
            heightmap = new Graphics.Software.Texel.R32F[250, 250];
            texture = new Graphics.Software.Texture<Graphics.Software.Texel.R32F>(heightmap);

            renderer = new Graphics.Renderer.Renderer(Device9) { Scene = scene, StateManager = new Device9StateManager(Device9) };
            renderer.Settings.ShadowQuality = Settings.ShadowQualities.NoShadows;
            renderer.Initialize(this);

            sceneRendererConnector = new SortedTestSceneRendererConnector
            {
                Renderer = renderer,
                Scene = scene
            };
            sceneRendererConnector.Initialize();

            scene.Add(ground = new TestGround
            {
                Size = new SizeF(100, 100),
                Heightmap = heightmap,
                NPieces = new Size(20, 20),
                Height = 1
            });
            ground.ConstructPieces();

            InputHandler = new WalkaroundCameraInputHandler
            {
                Camera = (LookatCartesianCamera)scene.Camera
            };
        }