Algorithm for creating spheres?

Posted by Dan the Man on Game Development See other posts from Game Development or by Dan the Man
Published on 2012-06-28T14:29:16Z Indexed on 2012/06/29 3:24 UTC
Read the original article Hit count: 290

Does anyone have an algorithm for creating a sphere proceduraly with la amount of latitude lines, lo amount of longitude lines, and a radius of r? I need it to work with Unity, so the vertex positions need to be defined and then, the triangles defined via indexes (more info).


EDIT

enter image description here

I managed to get the code working in unity. But I think I might have done something wrong. When I turn up the detailLevel, All it does is add more vertices and polygons without moving them around. Did I forget something?

© Game Development or respective owner

Related posts about unity

Related posts about procedural-generation