'cheese wedge ship design spin test.
CheeseTexture ch()
x = 400: y = 300
'all textures coordinate preload
ssx(f) = sx: ssy(f) = sy
sx
= sx
+ 120:
IF sx
> 800 - 120 THEN sx
= 0: sy
= sy
+ 120
'rotation:
RotoZoom ssx
(i
) + 75, ssy
(i
) + 75, ch
(i
), _DEST, 1, f!
, 1, 1 f! = f! + .01
' FOR i! = 0 TO 6.28 STEP .01
' RadianAngle = i!
' LINE (300, 200)-(500, 400), _RGB(0, 0, 0), BF 'erase spin area
' x1 = x + 60 * COS(RadianAngle) 'the wedge points
' y1 = y + 60 * SIN(RadianAngle)
' x2 = x + 30 * COS(RadianAngle + _PI(2 / 3))
' y2 = y + 30 * SIN(RadianAngle + _PI(2 / 3))
' x3 = x + 30 * COS(RadianAngle - _PI(2 / 3))
' y3 = y + 30 * SIN(RadianAngle - _PI(2 / 3))
' fTri x1, y1, x2, y2, x3, y3, _RGB(252, 221, 37) 'draw the wedge
'try to add some 'holes' to the wedge and have them stay in place while spining
' fcirc x + 15 * COS(RadianAngle + _PI(2 / 3)), y + 15 * SIN(RadianAngle + _PI(2 / 3)), 4, _RGB(148, 76, 36)
' fcirc x + 10 * COS(RadianAngle), y + 15 * SIN(RadianAngle), 3, _RGB(148, 76, 36)
' REM fcirc x + 20 * COS(RadianAngle - _PI(2 / 3)), y - 8 * SIN(RadianAngle - _PI(2 / 3)), 2, _RGB(148, 76, 36)
' fcirc x + 20 * COS(RadianAngle + _PI(2 / 3)), y + 20 * SIN(RadianAngle + _PI(2 / 3)), 2, _RGB(148, 76, 36)
'mark the main points of the triangle
' PSET (x1, y1), _RGB(255, 0, 0)
' PSET (x2, y2), _RGB(0, 255, 0)
' PSET (x3, y3), _RGB(0, 0, 255)
' 'mark the rotational center of the triangle
' PSET (x, y), _RGB(255, 0, 255): DRAW "ud2url2"
' _DELAY .01
' NEXT i!
' _LIMIT 30
FOR w
= 1 TO 10 'how much circles fcirc x, y, radius, Cheese&
'generate random cheese size:
gen:
_MAPTRIANGLE (x1
, y1
)-(x2
, y2
)-(x3
, y3
), V&
TO(x1
, y1
)-(x2
, y2
)-(x3
, y3
), ch
(TextureGen
)
'SUB fTri (x1, y1, x2, y2, x3, y3, K AS _UNSIGNED LONG)
' a& = _NEWIMAGE(1, 1, 32)
' _DEST a&
' PSET (0, 0), K
' _DEST 0
' _MAPTRIANGLE (0, 0)-(0, 0)-(0, 0), a& TO(x1, y1)-(x2, y2)-(x3, y3)
' _FREEIMAGE a& '<<< this is important!
'END SUB
'vince version
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!
= COS(-RotationR
/ 3.1415927): cosr!
= SIN(-RotationR
/ 3.1415927 * speed
) sinr!
= SIN(-RotationR
/ 3.1415927): cosr!
= COS(-RotationR
/ 3.1415927 * speed
) ' _limit 60 - speed
x2& = (px(i&) * cosr! + sinr! * py(i&)) * Scale + X: y2& = (py(i&) * cosr! - px(i&) * sinr!) * Scale + 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)), 0, _SMOOTH _MAPTRIANGLE (0, 0)-(W&
- 1, 0)-(W&
- 1, h&
- 1), Image&
TO(px
(0), py
(0))-(px
(3), py
(3))-(px
(2), py
(2)), 0, _SMOOTH
x0 = R
y0 = 0
e = 0
y0 = y0 + 1
LINE (x
- x0
, y
+ y0
)-(x
+ x0
, y
+ y0
), C
, BF
LINE (x
- x0
, y
- y0
)-(x
+ x0
, y
- y0
), C
, BF
e = e + 2 * y0
LINE (x
- y0
, y
- x0
)-(x
+ y0
, y
- x0
), C
, BF
LINE (x
- y0
, y
+ x0
)-(x
+ y0
, y
+ x0
), C
, BF
x0 = x0 - 1
e = e - 2 * x0
LINE (x
- R
, y
)-(x
+ R
, y
), C
, BF