예제 #1
0
파일: Program.cs 프로젝트: sealong/practice
        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);
        }
예제 #2
0
        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);
        }