-
Notifications
You must be signed in to change notification settings - Fork 0
/
國旗飄揚.fs
65 lines (65 loc) · 1.35 KB
/
國旗飄揚.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
\ ( I 國旗飄揚
\ ( I1 旗桿左右移動 週期 2 秒
: x x t 2 / sin 2 + 8 / - ; \ )
: 桿 x 0 > x .02 < *
x .01 - 2 ** y .98 - 2 ** +
sqrt .02 < + ;
\ ( I2 改 x y 值域 0 到 2
: x x 2 * ; : y y 2 * ; \ )
\ ( I3 國旗上下升降 週期 8 秒
: y y t 8 / sin 1 + 2 / - ; \ )
\ ( I4 國旗迎風飄動
: y x 3 / t 6 / pi 8 /
mod - pi * 10 *
cos 40 / \ 水平波動 dy
y + 1.1 * ; \ )
\ ( I5 改值域 x 0 到 4, y -3 到 1
: x x 2 * ; : y y 2 * 1 - ; \ )
: r \ 日心 到 x,y 距離
x .5 - 2 **
y .5 - 2 ** + sqrt ;
: θ \ 日心 到 x,y 角 徑度
x .5 - y .5 - atan2 ;
: n 12 ;
: α \ n角星 內頂角 徑度 的 一半
pi 9 / ; \ 改 9 為 2 即 n邊形
: a 2 pi * n / ; : h a 2 / ;
: β \ n 道 光芒
θ a mod h - abs ;
\ θ pi / 1 + 2 /
: n角星 α sin .3 *
α cos β sin * β cos α sin * +
/ r > ;
: 洞 r .17 > ; : 圓 r .1 < ;
: 日
n角星
洞 *
圓 +
;
: 天 y 0 > y .9 < *
x .1 > * x 1 < * ;
: 地 1 天 - y abs .9 < *
x .1 > * x 2 < * ;
: 幽暗大地 0 0 0 ; \ RGB 亮度歸零
: 藍天晨曦 \ 加 右上角 藍天晨曦
x y + .1 * + ;
: 綠野山嵐 \ 加 左下角 綠野山嵐
swap
.1 x y + 2 / .1 * - +
swap ;
: 國旗飄揚 \ 青天白日滿地紅
rot 日 + 地 +
rot 日 +
rot 天 +
;
: 升上桿頭 \ 升上 白色旗桿
rot 桿 +
rot 桿 +
rot 桿 + ;
\ ( I6 範例展示
幽暗大地
藍天晨曦
綠野山嵐
國旗飄揚
升上桿頭 \ )
\ )