Exemple #1
0
        void Reshape()
        {
            if (_camera == null)
            {
                _camera = new Camera {
                    FarPlane    = 1000.0F,
                    NearPlane   = 1.0F,
                    FieldOfView = MathHelper.PiOver2,
                    Target      = Vector3.Zero,
                    Location    = new Vector3(90, 0, 0)
                };
            }

            GL.Viewport(this.ClientRectangle);
            _camera.AspectRatio = this.ClientRectangle.Width / (float)this.ClientRectangle.Height;

            GL.MatrixMode(MatrixMode.Projection);
            Matrix4 projMatrix = _camera.ProjectionMatrix4;

            GL.LoadMatrix(ref projMatrix);
        }
        private void Reshape()
        {
            if (_camera == null) {
                _camera = new Camera {
                                         FarPlane = 1000.0F,
                                         NearPlane = 1.0F,
                                         FieldOfView = MathHelper.PiOver2,
                                         Target = Vector3.Zero,
                                         Location = new Vector3(90, 0, 0)
                                     };
            }

            GL.Viewport(ClientRectangle);
            _camera.AspectRatio = ClientRectangle.Width / (float)ClientRectangle.Height;

            GL.MatrixMode(MatrixMode.Projection);
            Matrix4 projMatrix = _camera.ProjectionMatrix4;
            GL.LoadMatrix(ref projMatrix);
        }