_Title "Swizzle Spin" ' b+ 2021-05-29 mod Dav mod b+ Const Xmax
= 600, Ymax
= 600, cxy
= 300, Pi
= _Pi Dim vScreenR
(Xmax
, Ymax
), vScreenG
(Xmax
, Ymax
), vScreenB
(Xmax
, Ymax
) restart:
Line (x
, 0)-(x
, Ymax
), _RGB32(128 + 128 * Sin(r
* x
), 128 + 128 * Sin(g
* x
), 128 + 128 * Sin(b
* x
)) vScreenR
(x
, y
) = 128 + 128 * Sin(r
* x
) vScreenG
(x
, y
) = 128 + 128 * Sin(g
* x
) vScreenB
(x
, y
) = 128 + 128 * Sin(b
* x
)
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)), _RGB32(r
, g
, b
) RotoZoom cxy, cxy, s&, 1, a
px(0) = -W& / 2: py(0) = -H& / 2: px(1) = -W& / 2: py(1) = H& / 2
px(2) = W& / 2: py(2) = H& / 2: px(3) = W& / 2: py(3) = -H& / 2
sinr!
= Sin(-Rotation
/ 57.2957795131): cosr!
= Cos(-Rotation
/ 57.2957795131) x2& = (px(i&) * cosr! + sinr! * py(i&)) * Scale + X: y2& = (py(i&) * cosr! - px(i&) * sinr!) * Scale + Y
px(i&) = x2&: py(i&) = y2&