我想制作一个程序,在 vpython 中显示达芬奇塔,我想我得到了正确的代码,可以像在达芬奇塔中一样按顺序旋转楼层。但是 vpython 没有响应。我做错了什么?有人可以帮忙吗?
from visual import *
from math import *
scene.autocenter=True
print "Give the desired square meters per floor:"
SquareMeters= int(raw_input());
side=sqrt(SquareMeters)
print "Give the desired height of the tower in meters"
demandedHeight= int(raw_input());
totalFloors = demandedHeight/3;
carryingStructure= cylinder(pos=(0,-1,0), axis=(0,demandedHeight,0), radius=10)
height=0;
floors=[]
v=frame()
while height < demandedHeight:
f = box(frame=v,pos=(0,height,0),size=(side,3,side))
floors.append(f)
height += 3.5
f
print totalFloors;
for floorNr in range(len(floors)):
floor = floors[floorNr]
floor.rotate(angle=0.01*floorNr, axis=(0,1,0), origin=(0,0,0))