`Entry - with added colours (but not flavours) `initialise screen set display mode 640,480,32 autocam off `declare variable for camera angle angle=225 `reset object number a=1 `create board make object cube 1601,100 `create pin make object cylinder 65000,10 scale object 65000,100,2000,100 make object sphere 65001,20 make mesh from object 65001,65001 delete object 65001 add limb 65000,1,65001 offset limb 65000,1,0,5,0 scale limb 65000,1,100,5,100 make mesh from object 65002,65000 delete object 65000 `stretch board scale object 1601,500,10,500 `position board position object 1601,0,0,0 `create pins For y = 1 to 40 For x = 1 to 40 `create object Make object a,65002,0 `scale object a,100,2000,100 `position object Position object a,(x*12)-240,(sin((9.0*x)+t#)+cos((9.0*y)+t#))*40.0,(y*12)-240 `increment object number Inc a Next x Next y zoom#=600 `main loop Do a=1 For y = 1 to 40 For x = 1 to 40 `reposition dependant on sine wave function and time Position object a,(x*12)-240,(sin((9.0*x)+t#)+cos((9.0*y)+t#))*40.0,(y*12)-240 color object a,RGB(pulsate(255,0,10,t#),pulsate(255,0,10,t#+12+(10*SIN(x))),pulsate(255,0,10,t#+12+(10*COS(y)))) Inc a Next x Next y `increment time inc t# ink 0xffffffff,0 set cursor 0,0 `display info print "Pin Pression simulation by calcyman" print "Press Left and right arrowkeys to rotate simulation" print "Press Up and Down to zoom in/out" print "polies: ";STATISTIC(1) `position camera dependant on angle, and point towards centre of simulation Position camera zoom#*SIN(angle),(zoom#*2.0)/3.0,zoom#*COS(angle) point camera 0,0,0 `change angle dependant on user input If leftkey()=1 then dec angle,5 If rightkey()=1 then inc angle,5 If upkey()=1 then dec zoom#,10 IF downkey()=1 then inc zoom#,10 `repeat loop Loop function pulsate(maximum as double float,minimum as double float,speed as double float, time as double float) value as double float value=((maximum+minimum)/2.0)+(((maximum-minimum)/2.0)*SIN(speed*time)) endfunction value