_TITLE "Moire with triangle sheets mod 3" ' B+ 2019-03-06
' Now the middle of the over sheet is where the mouse is
' and the angle the sheet is turned is the same angle
' the mouse is to the center of screen. Theoretically
' if you put the mouse dead center of the screen the 2 sheets
' will coincide and look like one sheet. But as mouse closes in
' at center the angle swing becomes more sensitive to slightest
' changes.
' mod #3 try it with color
pal(0) = red: pal(1) = grn: pal(2) = blu
s = 10
sd2 = 5
sh = sd2 * sq3
ccx = ccy
ftri tsheet&, x, y + sh, x + s, y + sh, x + sd2, y, pal(ccx)
scale = 1
angle
= _ATAN2(my
- cx
, mx
- cy
) RotoZoom2 mx, my, tsheet&, scale, scale, angle
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)
sinr!
= SIN(-Rotation
): cosr!
= COS(-Rotation
) x2& = (px(i&) * cosr! + sinr! * py(i&)) * xScale + X: y2& = (py(i&) * cosr! - px(i&) * sinr!) * yScale + Y
px(i&) = x2&: py(i&) = y2&
_MAPTRIANGLE (0, 0)-(0, H&
- 1)-(W&
- 1, H&
- 1), Image&
TO(px
(0), py
(0))-(px
(1), py
(1))-(px
(2), py
(2)) _MAPTRIANGLE (0, 0)-(W&
- 1, 0)-(W&
- 1, H&
- 1), Image&
TO(px
(0), py
(0))-(px
(3), py
(3))-(px
(2), py
(2))
' found at [abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]: http://www.[abandoned, outdated and now likely malicious qb64 dot net website - don’t go there]/forum/index.php?topic=14425.0