skip to main
|
skip to sidebar
4C-95452172-潘俊宏
2009年12月16日 星期三
作業七
主題:結晶
說明:各式各樣的雪花結晶
截圖:
影片:
原始碼:
size 100 100 3
paper 10 50 60
number mod x y
{
value (x-(y*(x/y)))
}
set rseed
number random x
{
set r1 (rseed*435437)
set r2 (rseed+945878)
set rseed
value
}
command circlepixels cx cy dx dy v
{
set [(cx+dx) (cy+dy)] v
set [(cx+dx) (cy-dy)] v
set [(cx-dx) (cy+dy)] v
set [(cx-dx) (cy-dy)] v
set [(cx+dy) (cy+dx)] v
set [(cx+dy) (cy-dx)] v
set [(cx-dy) (cy+dx)] v
set [(cx-dy) (cy-dx)] v
}
command circle cx cy radius v
{
set x 0
set y radius
set d (1-radius)
circlepixels cx cy x y v
// 707/1000 approximates square root of 0.5 = cos(45)
repeat x 0 (radius*707/1000)
{
set tempd d
smaller? tempd 0
{
set d (d+(2*x)+3)
}
notsmaller? tempd 0
{
set d (d+(2*(x-y))+5)
set y (y-1)
}
circlepixels cx cy x y v
}
}
set startx 0
set starty 0
forever
{
set startx
set starty
set repeattime
repeat b 0 repeattime
{
set a
circle startx starty a (startx+starty)
set [
] 0
}
}
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
我的網誌清單
互動 媒體 設計
考試
15 年前
追蹤者
網誌存檔
►
2011
(4)
►
8月
(4)
►
2010
(4)
►
1月
(4)
▼
2009
(11)
▼
12月
(3)
作業七
作業六-自由創作
作業六-自畫像
►
11月
(4)
►
10月
(2)
►
9月
(2)
關於我自己
ANUBIS
檢視我的完整簡介
沒有留言:
張貼留言