function GetSphereVertices( diameter, xdivisions, zdivisions ) local coords= { x = {}, y = {}, z = {} } 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.x, x ) table.insert( coords.y, y ) table.insert( coords.z, z ) end end return coords end