3d cone
Posted: Tue May 23, 2017 8:07 pm
Code: Select all
REM 3D cone
REM just having some fun with optics!
REM enjoy...
GRAPHICS
sh=SCREEN_HEIGHT()
sw=SCREEN_WIDTH()
circles = 8
DIM cx(circles+1), cy(circles+1), cxr(circles+1), cyr(circles+1)
DIM cc(circles+1), cs(circles+1), ct(circles+1), ctg(circles+1)
setup:
sizee = 220
c = 0
FOR i = 1 TO circles
cx(i) = sw/2! cy(i) = sh/2
cs(i) = sizee! sizee = sizee - 25
cc(i) = 1 - c! c = 1 - c
NEXT i
ctg(1) = 000
ctg(2) = 025
ctg(3) = 050
ctg(4) = 075
ctg(5) = 100
ctg(6) = 075
ctg(7) = 050
ctg(8) = 025
main:
REFRESH OFF
GRAPHICS CLEAR 0,0,0
FOR i = 1 TO circles
ct(i) = ct(i) + 0.05
cxr(i) = COS(ct(i)) * ctg(i)
cyr(i) = SIN(ct(i)) * ctg(i)
IF cc(i) = 0 THEN FILL COLOR 0,0,1
IF cc(i) = 1 THEN FILL COLOR 1,1, .1
FILL CIRCLE cx(i) + cxr(i), cy(i) + cyr(i) SIZE cs(i)
NEXT i
REFRESH
GOTO main