Is there a Technique or Algorithm for Building Spheres?
This website generates a sphere in LDraw format: http://lego.bldesign.org/sphere/

Here's a link if you want to learn how it can be done: http://groups.csail.mit.edu/graphics/classes/6.837/F04/assignments/assignment5/
(there are other ways too)