title: OpenGL Rotate camera around center-of-scene
body: <p>I have a scene which is basically a square floor measuring 15x15 (a quad with coordinates (0,0,0) (0,0,15) (15,0,15) (15,0,0) ).</p>
  
  <p>I 've set the center-of-scene to be at (7.5,0,7.5). Problem is I can't figure out how to rotate the camera horizontally around that center of scene (aka make the camera do a 360 horizontal circle around center-of-scene).  I know you need to do something with sin and cos, but don't know what exactly.</p>
  
  <p>Here is the code (plain C):</p>
  
  <pre><code>//set camera position
  //camera height is 17
  GLfloat camx=0, camy=17, camz=0;
  
  //set center of scene
  GLfloat xref=7.5, yref=0, zref=7.5;
  
  gluLookAt(camx, camy, camz, xref, yref, zref, 0, 1, 0);
  
  //projection is standard gluPerspective, nothing special
  gluPerspective(45, (GLdouble)width/(GLdouble)height, 1, 1000);
  </code></pre>