From: jon s. <js...@so...> - 2003-01-01 23:06:48
|
(Happy New Year!) This program builds blocks out into space correctly, but it automatically "zooms" way out (too far out) about midway through. I can't figure out how to control this. When I fiddle with scene.range, the image gets dim as if the lights have been turned down. I'd appreciate any ideas. from visual import * from time import sleep pause=.2 c=[] def init(): for i in range(10): c.append((0,0,0)) c[0]=[255,255,255] c[1]=[255,153,51] c[2]=[102,102,153] c[3]=[255,0,102] c[4]=[102,102,153] c[5]=[255,102,0] c[6]=[128,0,128] c[7]=[255,255,0] c[8]=[51,51,153] c[9]=[255,0,102] for each in c: for i in (0,1,2): each[i]=each[i]/255. scene.forward=[0.5,-0.5,-1] init() def tenblocks(firstblock=0): global pause for i in range(10): box(color=c[i],pos=(0,0,-firstblock + 10 -i)) print scene.forward if pause>0.1: pause= pause * 0.99 sleep(pause) def ShowUpTo(Number=50): Tens=Number/10 for i in range(Tens): tenblocks(firstblock=i*10) ShowUpTo(Number=100) |