title: using spherical coordinates in opengl
body: <p>I am trying to plot points around a center point using spherical coordinates. I know this is by far not the most efficient way to plot a sphere in OpenGL but i want to do it as an excersive to understand spherical coordinates better.</p>
  
  <p>I want to step through each point by a certain angle so for this i have  a nested for loop itterating through theta 0 - 360 and phi 0-360 and i am attempting to get the Cartesian coordinates of each of these steps and display it as a single point.</p>
  
  <p>so far i have this:</p>
  
  <pre><code>float r = 1.0;
  for( float theta = 0.0; theta &lt; 360.0; theta += 10.0){
      for(float phi = 0.0; phi &lt; 360.0; phi += 10.0){
  
          float x = r * sin(theta) * cos(phi);
          float y = r * sin(theta) * sin(phi);
          float z = r * cos(theta);
      }
  }
  </code></pre>
  
  <p>i store these points a display them. the display function works fine as i have used it to display other point structure before but for some reason i can't get this to work.</p>
  
  <p>I have also tried converting the angles from degrees to radians:</p>
  
  <pre><code>float rTheta = theta * M_PI * 180.0;
  float rPhi = phi * M_PI * 18.0;
  </code></pre>
  
  <p>as <code>sin()</code> and <code>cos()</code> both use radians but it yields the same results.</p>
  
  <p>Am i doing something wrong and badly misunderstanding something?</p>