title: How to randomize points on a sphere surface evenly?
body: <p>Im trying to make stars on the sky, but the stars distribution isnt even.</p>
  
  <p>This is what i tried:</p>
  
  <pre><code>rx = rand(0.0f, PI*2.0f);
  ry = rand(0.0f, PI);
  x = sin(ry)*sin(rx)*range;
  y = sin(ry)*cos(rx)*range;
  z = cos(ry)*range;
  </code></pre>
  
  <p>Which results to:</p>
  
  <p><a href="http://img716.imageshack.us/img716/3320/sphererandom.jpg" rel="nofollow noreferrer">img http://img716.imageshack.us/img716/3320/sphererandom.jpg</a></p>
  
  <p>And:</p>
  
  <pre><code>rx = rand(-1.0f, 1.0f);
  ry = rand(-1.0f, 1.0f);
  rz = rand(-1.0f, 1.0f);
  x = rx*range;
  y = ry*range;
  z = rz*range;
  </code></pre>
  
  <p>Which results to:</p>
  
  <p><a href="http://img710.imageshack.us/img710/5152/squarerandom.jpg" rel="nofollow noreferrer">img2 http://img710.imageshack.us/img710/5152/squarerandom.jpg</a></p>
  
  <p>(doesnt make a sphere, but opengl will not tell a difference, though).</p>
  
  <p>As you can see, there is always some "corner" where are more points in average. How can i create random points on a sphere where the points will be distributed evenly?</p>