08-20-2022, 06:53 PM
I added mouse wheel support so you can spin it both ways and speed it up and slow it down.
Code: (Select All)
_Title "Anemometer Wind Gauge by SierraKen - Use Mouse Wheel"
Screen _NewImage(800, 600, 32)
t = 900
t2 = 1350
t3 = 1800
cc = 200
Do
_Limit 30
While _MouseInput: wheel = wheel + _MouseWheel: Wend
If wheel > 10 Then wheel = 10
If wheel < -10 Then wheel = -10
If t < 90 Then t = 900
If t2 < 135 Then t2 = 1350
If t3 < 180 Then t3 = 1800
x = (Sin(t) * 20) * (_Pi * 2) + 400
y = (Cos(t) * 10) * (_Pi / 2) + 200
r = (Cos(t) * 180) / _Pi / 1.5 + 50
t = t - (.25 + wheel / 10)
x2 = (Sin(t2) * 20) * (_Pi * 2) + 400
y2 = (Cos(t2) * 10) * (_Pi / 2) + 200
r2 = (Cos(t2) * 180) / _Pi / 1.5 + 50
t2 = t2 - (.25 + wheel / 10)
x3 = (Sin(t3) * 20) * (_Pi * 2) + 400
y3 = (Cos(t3) * 10) * (_Pi / 2) + 200
r3 = (Cos(t3) * 180) / _Pi / 1.5 + 50
t3 = t3 - (.25 + wheel / 10)
For S = .25 To r Step .1
cc = cc - .25
Circle (x, y), S, _RGB32(cc, cc, 100 + cc)
Next S
cc = 200
For S = .25 To r2 Step .1
cc = cc - .25
Circle (x2, y2), S, _RGB32(cc, 100 + cc, cc)
Next S
cc = 200
For S = .25 To r3 Step .1
cc = cc - .25
Circle (x3, y3), S, _RGB32(100 + cc, cc, cc)
Next S
cc = 200
Line (400, 200)-(x, y), _RGB32(255, 255, 255)
Line (400, 200)-(x2, y2), _RGB32(255, 255, 255)
Line (400, 200)-(x3, y3), _RGB32(255, 255, 255)
cc2 = 100
For sz = .1 To 100 Step .25
cc2 = cc2 - .25
Circle (400, 450), sz, _RGB32(100 + cc2, 100 + cc2, cc2), , , .5
Next sz
Line (400, 200)-(400, 450), _RGB32(255, 255, 255)
_Display
Cls
Loop Until InKey$ = Chr$(27)