Example #1
0
 public void doShoot(CameraMode projection)
 {
     // Set Viewport
     ApplyViewPort();
     // Set perspective
     if (projection == CameraMode.PERSPECTIVE)
     {
         Glut.Glut.Perspective(computeFieldOfView(RenderingSphereRadius * 2, Eye.distance(Target)), (StretchToFill ? _screenWidth / _screenHeight : 1), Near, Far);
     }
     else if (projection == CameraMode.ORTHOGONAL)
     {
         GL.Ortho(-RenderingSphereRadius, +RenderingSphereRadius, -RenderingSphereRadius, +RenderingSphereRadius, Near, Far);
     }
     else
     {
         throw new Exception("Camera.shoot() : unsupported projection mode '" + projection + "'");
     }
     // Set camera position
     Glut.Glut.LookAt(Eye.x, Eye.y, Eye.z, Target.x, Target.y, Target.z, Up.x, Up.y, Up.z);
 }