Esempio n. 1
0
        public void Initialize()
        {
            camera = new Camera();
            camera.UpdatePosition(new Vector3(0, 100, 0));

            textInfoPanel        = new InfoPanelFor3Dview(Content);
            textInfoPanel.Camera = camera;
            AddSubRenderer(textInfoPanel);

            projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, Device.Viewport.AspectRatio,
                                                                   Config.Instance.Rendering.NearClippingDistance, Config.Instance.Rendering.FarClippingDistance);

            effect = Content.Load <Effect>("effect");

            waterRenderer     = new WaterRenderer(Content, SceneContent, camera);
            skyRenderer       = new SkyRenderer(Content, camera);
            secondDepthBuffer = new DepthStencilBuffer(Device, Device.PresentationParameters.BackBufferWidth, Device.PresentationParameters.BackBufferHeight, Device.DepthStencilBuffer.Format);

            Mouse.SetPosition(Device.Viewport.Width / 2, Device.Viewport.Height / 2);
            originalMouseState = Mouse.GetState();
        }
        public void Initialize()
        {
            camera = new Camera();
             camera.UpdatePosition(new Vector3(0, 100, 0));

             textInfoPanel = new InfoPanelFor3Dview(Content);
             textInfoPanel.Camera = camera;
             AddSubRenderer(textInfoPanel);

             projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, Device.Viewport.AspectRatio,
            Config.Instance.Rendering.NearClippingDistance, Config.Instance.Rendering.FarClippingDistance);

             effect = Content.Load<Effect>("effect");

             waterRenderer = new WaterRenderer(Content, SceneContent, camera);
             skyRenderer = new SkyRenderer(Content, camera);
             secondDepthBuffer = new DepthStencilBuffer(Device, Device.PresentationParameters.BackBufferWidth, Device.PresentationParameters.BackBufferHeight, Device.DepthStencilBuffer.Format);

             Mouse.SetPosition(Device.Viewport.Width / 2, Device.Viewport.Height / 2);
             originalMouseState = Mouse.GetState();
        }