# File: surface_sphere.py # Author: Petr Sorfa # Desc: A surface is used to create a sphere. import am import math am.begin() sphere_res = 6 am.surface_begin() for angle0 in range(sphere_res): ang0 = math.pi*angle0/(sphere_res-1) + math.pi/2.0 x0 = math.cos (ang0) y0 = math.sin (ang0) row = [] for angle1 in range(sphere_res): ang1 = math.pi*2*angle1/(sphere_res) x1 = x0*math.cos (ang1) y1 = x0*math.sin (ang1) row += [x1, y0, y1] am.surface_add_row (row) am.surface_set_closed () am.surface_end() am.end()