Monday, May 18, 2009

clau_tower of points



#creating a tower of points
numRows= 90
numColumns=42
numLevels=12
amplitude = 5
for i in range (-1,numRows,1):
x= sin(6*i)*amplitude
print "row", i
for j in range (-1,numColumns,2):
y= cos(i)*3
print "column", j
for k in range (0,numLevels,1.5):
z= k+1
myPoint=(x,y,z)
cmds.spaceLocator(p=myPoint)

1 comment:

  1. Nice. This shows you you grasped the concept of nested loops. One important efficiency factor when doing long nested loops: try to only use the print command if you really need it. Otherwise the execution of your code get's really slow. Also, don't forget to comment all the code: it will help you and others to understand it later!

    ReplyDelete