September 28, 2021, 05:07:05

### Author Topic: Swizzle 2  (Read 295 times)

#### bplus

• Full Member
• Posts: 221
##### Swizzle 2
« on: May 30, 2021, 17:27:41 »
A quickie:
Code: [Select]
`REM SmallBASICREM created: 30/05/2021 B+Const Xmx = 600const Ymx = 600const cxy = 300Dim vScreenR(Xmx, Ymx), vScreenG(Xmx, Ymx), vScreenB(Xmx, Ymx)label restartr = Rnd * Rnd * .25: g = Rnd * Rnd * .25: b = Rnd * Rnd * .25For x = 0 To .5 * Xmx    rect x, x,Xmx - x, Ymx - x, RGB(127 + 127 * Sin(r * x), 127 + 127 * Sin(g * x), 127 + 127 * Sin(b * x))    For y = x To Ymx - x        vScreenR(x, y) = 127 + 127 * Sin(r * x)        vScreenG(x, y) = 127 + 127 * Sin(g * x)        vScreenB(x, y) = 127 + 127 * Sin(b * x)        vScreenR(Xmx - x, y) = 127 + 127 * Sin(r * x)        vScreenG(Xmx - x, y) = 127 + 127 * Sin(g * x)        vScreenB(Xmx - x, y) = 127 + 127 * Sin(b * x)    Next    For y = x To Xmx - x        vScreenR(y, x) = 127 + 127 * Sin(r * x)        vScreenG(y, x) = 127 + 127 * Sin(g * x)        vScreenB(y, x) = 127 + 127 * Sin(b * x)        vScreenR(Xmx - y, Ymx - x) = 127 + 127 * Sin(r * x)        vScreenG(Xmx - y, Ymx - x) = 127 + 127 * Sin(g * x)        vScreenB(Xmx - y, Ymx - x) = 127 + 127 * Sin(b * x)    NextNextshowpagedelay 500swizzle = Rnd * .2 + .9For radius = 1 To 300    For a = 0 To 2 * Pi Step 1 / (2 * Pi * radius)        x = Int(cxy + radius * Cos(a))        y = Int(cxy + radius * Sin(a))        r = vScreenR(x, y)        g = vScreenG(x, y)        b = vScreenB(x, y)        PSet cxy + radius * Cos(a + radius ^ swizzle * Pi / 180), cxy + radius * Sin(a + radius ^ swizzle * Pi / 180), RGB(r, g, b)    NextNextshowpagedelay 1000GoTo restart`