title: How alter the camera in opengl so I can see my entire surface plot on screen?
body: <p>I am using sharpgl in my wpf application and I have a surface plot. The problem is when I try to move the lookat camera away a lot of my plot disappears.... I'm new to opengl, how can I adjust my camera so I can see my plot from multiple sides?</p>
  
  <pre><code>namespace SharpGLWPFApplication1
  {
      /// &lt;summary&gt;
      /// Interaction logic for MainWindow.xaml
      /// &lt;/summary&gt;
      public partial class MainWindow : Window
      {
  
       ///this is a set of 29 by 121 arrays cant put all data here on stackoverflow
          double[][] surface = new double[29][] 
              {new double[] { 0.157502594025719, 0.160975938019107, 0.168564003076642, 0.171284471913381, 0.174722441310675, 0.182467533566265, 0.190681891360462, 0.197452867532186, ..... }};
  
  
  
          /// &lt;summary&gt;Initializes a new instance of the &lt;see cref="MainWindow"/&gt; class.&lt;/summary&gt;
          public MainWindow()
          {
              InitializeComponent();
          }
  
          /// &lt;summary&gt;
          /// Handles the OpenGLDraw event of the openGLControl1 control.
          /// &lt;/summary&gt;
          /// &lt;param name="sender"&gt;The source of the event.&lt;/param&gt;
          /// &lt;param name="args"&gt;The &lt;see cref="SharpGL.SceneGraph.OpenGLEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
          private void openGLControl_OpenGLDraw(object sender, OpenGLEventArgs args)
          {
              //  Get the OpenGL object.
              OpenGL gl = openGLControl.OpenGL;
  
              //  Clear the color and depth buffer.
              gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);
  
              //  Load the identity matrix.
              gl.LoadIdentity();
  
              //  Rotate around the Y axis.
              gl.Rotate(rotation, 0.0f, 1.0f, 0.0f);
  
              //  Nudge the rotation.
              rotation += 3.0f;
  
              float R = 0.3f;
              float G = 0.2f;
              float B = 0.1f;
  
              gl.Translate(-10f, 0f, 0f);
              gl.Begin(OpenGL.GL_TRIANGLES);
              for (int x = 1; x &lt; surface.GetUpperBound(0); ++x)
              {
  
                  for (int y = 1; y &lt; surface[0].GetUpperBound(0) + 1; ++y)
                  {
                      gl.Color(R, G, B);
                      double a = surface[x - 1][y - 1];
                      double b = surface[x][y - 1];
                      double c = surface[x][y];
                      double d = surface[x - 1][y];
                      // get four points on the surface (they form a quad)
  
                      gl.Vertex(x - 1, a, y - 1);
                      gl.Vertex(x, b, y - 1);
                      gl.Vertex(x, c, y);
                      // draw triangle abc
  
                      gl.Vertex(x - 1, a, y - 1);
                      gl.Vertex(x, c, y);
                      gl.Vertex(x - 1, d, y);
                      // draw triangle acd
                      R += y;
                      B += .0003f;
                      G += .0001f;
                  }
                  //R += .03f;
                  //B += .03f;
                  //G += .03f;
              }
  
              gl.End();
  
  
  
  
          }
  
          /// &lt;summary&gt;
          /// Handles the OpenGLInitialized event of the openGLControl1 control.
          /// &lt;/summary&gt;
          /// &lt;param name="sender"&gt;The source of the event.&lt;/param&gt;
          /// &lt;param name="args"&gt;The &lt;see cref="SharpGL.SceneGraph.OpenGLEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
          private void openGLControl_OpenGLInitialized(object sender, OpenGLEventArgs args)
          {
              //  TODO: Initialise OpenGL here.
  
              //  Get the OpenGL object.
              OpenGL gl = openGLControl.OpenGL;
  
              //  Set the clear color.
              gl.ClearColor(0, 0, 0, 0);
          }
  
          /// &lt;summary&gt;
          /// Handles the Resized event of the openGLControl1 control.
          /// &lt;/summary&gt;
          /// &lt;param name="sender"&gt;The source of the event.&lt;/param&gt;
          /// &lt;param name="args"&gt;The &lt;see cref="SharpGL.SceneGraph.OpenGLEventArgs"/&gt; instance containing the event data.&lt;/param&gt;
          private void openGLControl_Resized(object sender, OpenGLEventArgs args)
          {
              //  TODO: Set the projection matrix here.
  
              //  Get the OpenGL object.
              OpenGL gl = openGLControl.OpenGL;
  
              //  Set the projection matrix.
              gl.MatrixMode(OpenGL.GL_PROJECTION);
  
              //  Load the identity.
              gl.LoadIdentity();
  
              //  Create a perspective transformation.
              gl.Perspective(60.0f, (double)Width / (double)Height, 0.01, 100.0);
  
              //  Use the 'look at' helper function to position and aim the camera.
              gl.LookAt(-105, 105, -105, 50, 0, 0, 0, 1, 0);
  
              //  Set the modelview matrix.
              gl.MatrixMode(OpenGL.GL_MODELVIEW);
          }
  
          /// &lt;summary&gt;
          /// The current rotation.
          /// &lt;/summary&gt;
          private float rotation = 0.0f;
      }
  }
  </code></pre>