3d cone

Post Reply
DrChip
Posts: 167
Joined: Wed Oct 22, 2014 3:26 pm
My devices: iPhone 4 to 6+,iPad mini to iPad air 2

3d cone

Post by DrChip »

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
Attachments
IMG_4874.PNG
IMG_4874.PNG (635.74 KiB) Viewed 2295 times
IMG_4873.PNG
IMG_4873.PNG (619.45 KiB) Viewed 2295 times
IMG_4872.PNG
IMG_4872.PNG (619.06 KiB) Viewed 2295 times

User avatar
rbytes
Posts: 1338
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: 3d cone

Post by rbytes »

The illusion of depth is very convincing. :D
The only thing that gets me down is gravity...

Post Reply