03-28-2005, 05:00 PM
i got bored just now so played with the code abit
Code:
SCREEN 19, 32, 2' ,-1 I can't run gfxlib in full screen :(
'mangleberry pie :D
#DEFINE Pi 3.14 '15926535897932
x! = 150
y! = 150
z! = 150
Dim tSin(360) as Single, tCos(360) as Single
For i = 0 to 360
tSin(i) = SIN(i * (Pi/180))
tCos(i) = COS(i * (Pi/180))
Next
centx = 400
centy = 300
LENS = 256 ' centz
randomize timer
ax = 0
ay = 0
az = 0
T! = TIMER
DO
press$ = INKEY$
cx! = tCos(ax)
sx! = tSin(ax)
cy! = tCos(ay)
sy! = tSin(ay)
cz! = tCos(az)
sz! = tSin(az)
ny! = (y! * cx!)-(z! * sx!)
nz! = (z! * cx!)+(y! * sx!)
y! = ny!
z! = nz!
nz! = (z! * cy!)-(x! * sy!)
nx! = (x! * cy!)+(z! * sy!)
x! = nx!
nx! = (x! * cz!)-(y! * sz!)
ny! = (y! * cz!)+(x! * sz!)
ax += 1
If ax > 360 then ax -= 360
ay += 1
If ay > 360 then ay -= 360
az += 1
If az > 360 then az -= 360
PSET (centx + ny!/2, centy - nx!), RGB(nx! shr z! mod 255, ny! shl Z! mod 255, z!*cz! mod 255 )
PSET (centx + nx!+int(rnd(100)), centy - ny!-int(rnd(100))), RGB(nx! shr z! mod 255, ny! shl Z! mod 255, z!*cz! mod 255 )
F += 1
LOOP UNTIL press$ = CHR$(27)
PRINT "Average FPS:"; F / (TIMER - T!)
SLEEP