#
# CSC 112 Ambrosia Example: random numbers for object placement
# and the number of cones to place, and the height of each
#
# In this case, we add 30-50 cones who sit atop the xz-plane, but
# whose x and z-coordinates are randomly chosen between -400 and
# 400 in each dimension
#
# Jim Teresco, The College of Saint Rose, Fall 2015
#
from ambrosia import *
import random
# define a green cone, 50x50x50, sitting atop the xz-plane, with
# its axis along the y-axis
greenCone = Cone()
greenCone.material(greenPlastic).scale(.5,.5,.5).translate(0,25,0)
# a floor
scene.add(Plane(), whitePlaster)
# pick a random number of cones to place
numCones = random.randint(30,50)
# place numCones of these randomly in our scene, now with
# an additional scaling factor from .5 to 2 that will result in
# cone heights ranging from 25 to 100
for coneNum in range(numCones):
scene.add(greenCone, scale(1,random.uniform(.5,2),1)*
translate(random.uniform(-400,400), 0,
random.uniform(-400,400)))
camera.pos([0,300,-500]).shoot()