#
# CSC 112 Ambrosia Example: using morph to accomplish some replication
# using positions along a quadratic bezier curve
#
# Jim Teresco, The College of Saint Rose, Fall 2015
#
from ambrosia import *
# Create a morph of 20 positions from (-200,0,0) to (200,0,0)
# but this time we give morph 3 parameters after the number of
# transitions, so it will use a quadratic Bezier path
twentySpotsOnXAxis = morph(19, (-200, 0, 0), (0, 200, 0), (200, 0, 0))
# make a little red sphere
littleRedSphere = Sphere().scale(.1, .1, .1).material(redPlaster)
# now we can use a for loop to visit each of the positions in
# the list returned to us by morph
for pos in twentySpotsOnXAxis:
(x, y, z) = pos
scene.add(littleRedSphere, translate(x, y, z))
camera.shoot()