|
Post by johnno56 on Jun 30, 2019 17:10:47 GMT -6
This is yet another Polygon experiment converted from basic256. Why? Because it was there and I needed practice using poly / polyFill...
'# mobius.kbs Basic256 '# rotating mobius strip - j.m.reneau xmax = 600 ymax = 600 title$ = "Rotating Mobius Strip" WindowOpen(1,title$,0,0,xmax,ymax,0) CanvasOpen(1,xmax,ymax,0,0,xmax,ymax,0) ClearCanvas
dim px[4] dim py[4] dim c[3] c[0] = rgb(255,0,0) c[1] = rgb(0,255,0) c[2] = rgb(0,0,255) pi = 3.141592654 w = 0.20 '# width of strip dr = 2 * pi / 100 '# size of rotation in frame speed = 20 '# pause between frames r = 0
do clearcanvas for t = 0 to 2 px[0] = sin((t - w) * pi * 2 / 3 + r) * xmax / 2 + xmax / 2 py[0] = cos((t - w) * pi * 2 / 3 + r) * ymax / 2 + ymax / 2 px[1] = sin((t + w) * pi * 2 / 3 + r) * xmax / 2 + xmax / 2 py[1] = cos((t + w) * pi * 2 / 3 + r) * ymax / 2 + ymax / 2 px[2] = sin((t + 1 - w) * pi * 2 / 3 + r) * xmax / 2 + xmax / 2 py[2] = cos((t + 1 - w) * pi * 2 / 3 + r) * ymax / 2 + ymax / 2 px[3] = sin((t + 1 + w) * pi * 2 / 3 + r) * xmax / 2 + xmax / 2 py[3] = cos((t + 1 + w) * pi * 2 / 3 + r) * ymax / 2 + ymax / 2 setColor(c[t]) polyFill(4,px,py) next update() r = r + dr wait(speed) loop until key(k_escape) = 1
To go out for my morning coffee...
|
|
|
Post by tbird on Jun 30, 2019 22:47:53 GMT -6
Neat as usual johnno56 ...also hurts my eyes lol.
|
|
|
Post by johnno56 on Jul 1, 2019 1:15:18 GMT -6
Oh. Speaking of sore eyes... or eye sores.... Do you remember the old Anaglyph 3D images? Do you know of any old 'basic' driven anaglyph programs? Then the next logical step would be a game.... Cool...
|
|