#!/usr/bin/env python # Author: Brady O'Brien # Date: April 10, 2013 # This chunck of python simulates a bunch of balls being emmited from a fountain and then bouncing around in the scene # It also generates the 'balls.inc' file containing the xyz position for each ball for every frame import random #xyz positions for each frame ballhist = [] #current positions for every ball #Note: ballcur[b][6] determines weather or not calculations are done on that ball #x,y,z,vx,vy,vz,ph ballcur = [] #acceleration of gravity accy = -.3 #number of balls ballcnt = 300 #number of frames ballsteps = 300 #initalize all balls with random velocities and physics turned off. for i in range(ballcnt): ballcur.append([0,2,0,(random.random())-.5,(random.random()*1)+4,(random.random())-.5,0]) ballhist.append([ballcur[i][0:3]]) #Compute the physics for each frame. for t in range(ballsteps): if(len(ballcur)