Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Yabasic => Topic started by: Clanky on August 31, 2008

Title: Optical Illusion
Post by: Clanky on August 31, 2008
Wow.. been a long time since I've been back.. or for the matter, come in contact with Yab!
Hello peeps!!!
Glad to see the site is still here and full of fantastic code and posts.

Here is, a 5 minute job of an optical illusion which I saw on a website. Is it good? Not sure. It works though lol. Hope you enjoy. Nothing fancy.

Code: [Select]
open window 640, 512

circles = 8
dim cx(circles), cy(circles), cxr(circles), cyr(circles)
dim cc(circles), cs(circles), ct(circles), ctg(circles)

setup()

sub setup()
size = 220
c = 0
for i = 1 to circles
cx(i) = 320: cy(i) = 256
cs(i) = size: size = size - 25
cc(i) = 1 - c: c = 1 - c
next
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()
end sub

sub main()
label loop
setdrawbuf db
db = 1 - db
setdispbuf db
clear window

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 setrgb 1, 000, 000, 250
if cc(i) = 1 setrgb 1, 255, 255, 010
fill circle cx(i) + cxr(i), cy(i) + cyr(i), cs(i)
next
goto loop
end sub

Title: Re: Optical Illusion
Post by: Shockwave on August 31, 2008
It looks superb!

It's like looking down into a wobbling stripy pot in 3D :D

NIce one!
Title: Re: Optical Illusion
Post by: rain_storm on September 02, 2008
Cool its like a hypnodisc, what site did you see that on?
Title: Re: Optical Illusion
Post by: Galileo on September 04, 2014
 :clap:  :clap:  :clap: