# File: p3d_3halfspheres.py # Author: Petr Sorfa # Desc: A parametric surface collection of 3 # half spheres. import am # import the Animation Master extension import math # import the math extension am.begin() # Initialize the AM session for wi in range(3): w = wi + 1.0 am.surface_begin() for ui in range(10): u = ui*math.pi/9.0 row = [] for vi in range(10): v = vi*math.pi/9.0 x = w*math.sin(u)*math.cos(v) y = w*math.cos(u)*math.cos(v) z = w*math.sin(v)+2*w row += [x, y, z] am.surface_add(row) am.surface_end() am.end() # Finish the AM session