- private void SetUpViewPort()
- {
- // Compute the size of the glControl1.
- int width = glControl1.Width;
- int height = glControl1.Height;
- // Tell OpenGL how to compute pixels to coordinates.
- GL.Viewport(0, 0, width, height);
- // Choose Matrix.
- GL.MatrixMode(MatrixMode.Projection);
- // Reset camera.
- GL.LoadIdentity();
- // Multiplying the projection matrix with a perspective one.
- OpenTK.Graphics.Glu.Perspective(90.0, width / height, -500, 500);
- GL.MatrixMode(MatrixMode.Modelview);
- }