title: Ray tracing glossy reflection: sampling ray direction
body: <p>I'm writing a ray tracer for iPad. Now I'm trying to add glossy reflection to an object. How do I implement it? I read some documentation online:</p>
  
  <p><a href="http://www.cs.cmu.edu/afs/cs/academic/class/15462-s09/www/lec/13/lec13.pdf" rel="nofollow">http://www.cs.cmu.edu/afs/cs/academic/class/15462-s09/www/lec/13/lec13.pdf</a> <a href="http://www.cs.cornell.edu/courses/cs4620/2012fa/lectures/37raytracing.pdf" rel="nofollow">http://www.cs.cornell.edu/courses/cs4620/2012fa/lectures/37raytracing.pdf</a></p>
  
  <p>If I understood correctly instead of trace a single ray as for standard reflection I have to trace n ray in a random direction. <strong>How do I get this random direction for each ray? How do I generate these samples?</strong></p>