function GetSphereVertices( diameter, xdivisions, zdivisions ) local coords= {} for z = 0, 1, ( 1 / zdivisions ) do for angle = 0, 360,( 360 / xdivisions ) do x,y = math.sin( angle ), math( angle ) x,y,z = ( x * diameter ), ( y * diameter ), ( z * diameter ) table.insert( coords, Vector( x,y,z ) ) end end return coords end