不過上課交的電風扇感覺有點複雜,而且竟然是去年的期中考題,讓人有點緊張,原來這是期中考的level,不過比期中考更讓人煩惱的是期中project......
2011年1月6日 星期四
HW06
HW06 :
HW06_2 :

http://csie.fju.edu.tw/~ie985240/HW06_2/index.html
HW06_2b :
http://csie.fju.edu.tw/~ie985240/HW06_2b/index.html
HW06_3 :

http://csie.fju.edu.tw/~ie985240/HW06_3/index.html
Hw06_3b :


http://csie.fju.edu.tw/~ie985240/HW06_3b/index.html
HW06_exercise :
http://csie.fju.edu.tw/~ie985240/HW06_exercise/index.html
HW06_2 :

http://csie.fju.edu.tw/~ie985240/HW06_2/index.html
HW06_2b :
http://csie.fju.edu.tw/~ie985240/HW06_2b/index.html
HW06_3 :

http://csie.fju.edu.tw/~ie985240/HW06_3/index.html
Hw06_3b :


http://csie.fju.edu.tw/~ie985240/HW06_3b/index.html
HW06_exercise :
http://csie.fju.edu.tw/~ie985240/HW06_exercise/index.html
2011年1月5日 星期三
2010年12月29日 星期三
2010年11月24日 星期三
2010年11月19日 星期五
2010年11月11日 星期四
HW06
HW06
http://www.csie.fju.edu.tw/~ie975220/HW06/index.html
這次把每個圓的顏色用亂數存起
再讓越後面的圓跑的較慢
滑鼠在動時圓會跟滑鼠動
每個顏色都不同看起來很鮮豔很漂亮
每次都用差不多的指令做出許多不同的小程式
感覺受益良多
HW06

http://csie.fju.edu.tw/~ie985231/HW06/applet/index.html
心得:這次作業思考了發現加個random進去
之後就能產生這樣的效果。把既有的程式碼
做跟改,再去研究改出來的東西。應該算是
順利完成的作業,昨完好累可是好開心。
2010年11月10日 星期三
2010年10月29日 星期五
HW06
6_2: rotate(), p.209(236)
http://140.136.150.78/IM2010/HW06/b/applet/
6_3: easing, p.239(266)
http://140.136.150.78/IM2010/HW06/c/applet/
6_4: storing mouse data p.306(333)
http://140.136.150.78/IM2010/HW06/d/applet/
這次學會透過陣列座標傳遞來達成移動的效果。
p.160
translate(x, y)
if translate(10,30) , rec(0,5,20,20) 的座標系統會轉成在 (10,35) 的位置開始畫
所有在translate( )後畫的東西做標系統都會改變
如果連續寫translate( ), 座標直會相加
ex:
translate(10,30)
rect(0,5,20,20) --> draw from 10,35
translate(10,30)
rect(0,5,20,20) --> draw from 20,70
p.164
rotate(angle): function rotates the coordinate system so that shapes can be drawn
to the screen at an angle. --> that's why need translate()
Shapes are always rotated around their position relative to the origin (0,0), and positive
numbers rotate them in a clockwise direction.
rotate和translate一樣,連續寫的話也會累積,0.0 to 2π.
ex:
rotate(PI/2)
rotate(-PI/8)
translate(width/2, height/2); --> 位移座標系統
rotate(PI/8);
rect(-25, -25, 50, 50); --> 畫在中央
with for:
translate(66, 33); // Set initial offset
for (int i = 0; i < 18; i++)
{ // 18 repetitions
strokeWeight(i); // Increase stroke weight
rotate(PI/12); // Accumulate the rotation
line(0, 0, 55, 0);
}
p.252
if ((keyPressed == true) && (key == 'A'))
If you want to check for both uppercase and lowercase letters, you have to extend the
relational expression with a logical OR, the || relational operator.
--> if ((keyPressed == true) && ((key == 'a') || (key == 'A')))
key code: Alt, Control, Shift, Backspace, Tab, Enter, Return, Escape, Delete,ALT, CONTROL, SHIFT, UP, DOWN, LEFT, RIGHT
用之前要先if (key == CODED)
ex:
if (key == CODED)
{
if (keyCode == UP) { }
}
p.258
mouseMoved() : block is run at the end of each frame when the mouse moves and no button is pressed.
mouseDragged() block does the same when the mouse button is pressed
p. 266
Easing, also called interpolation, is a technique for moving between two points.
As the shape approaches the target position, the distance moved each frame decreases.
The easing variable sets the fraction of the distance between the circle’s current
position and the position of the mouse that the circle moves each frame.
between 0.0 and 1.0,
The value of this variable changes how quickly the circle will reach the target.
An easing value of 0.5 means the circle will move half the distance each frame and an
easing value of 0.01 means the circle will move one hundredth of the distance each
frame.
http://140.136.150.78/IM2010/HW06/b/applet/
6_3: easing, p.239(266)
http://140.136.150.78/IM2010/HW06/c/applet/
6_4: storing mouse data p.306(333)
http://140.136.150.78/IM2010/HW06/d/applet/
這次學會透過陣列座標傳遞來達成移動的效果。
p.160
translate(x, y)
if translate(10,30) , rec(0,5,20,20) 的座標系統會轉成在 (10,35) 的位置開始畫
所有在translate( )後畫的東西做標系統都會改變
如果連續寫translate( ), 座標直會相加
ex:
translate(10,30)
rect(0,5,20,20) --> draw from 10,35
translate(10,30)
rect(0,5,20,20) --> draw from 20,70
p.164
rotate(angle): function rotates the coordinate system so that shapes can be drawn
to the screen at an angle. --> that's why need translate()
Shapes are always rotated around their position relative to the origin (0,0), and positive
numbers rotate them in a clockwise direction.
rotate和translate一樣,連續寫的話也會累積,0.0 to 2π.
ex:
rotate(PI/2)
rotate(-PI/8)
translate(width/2, height/2); --> 位移座標系統
rotate(PI/8);
rect(-25, -25, 50, 50); --> 畫在中央
with for:
translate(66, 33); // Set initial offset
for (int i = 0; i < 18; i++)
{ // 18 repetitions
strokeWeight(i); // Increase stroke weight
rotate(PI/12); // Accumulate the rotation
line(0, 0, 55, 0);
}
p.252
if ((keyPressed == true) && (key == 'A'))
If you want to check for both uppercase and lowercase letters, you have to extend the
relational expression with a logical OR, the || relational operator.
--> if ((keyPressed == true) && ((key == 'a') || (key == 'A')))
key code: Alt, Control, Shift, Backspace, Tab, Enter, Return, Escape, Delete,ALT, CONTROL, SHIFT, UP, DOWN, LEFT, RIGHT
用之前要先if (key == CODED)
ex:
if (key == CODED)
{
if (keyCode == UP) { }
}
p.258
mouseMoved() : block is run at the end of each frame when the mouse moves and no button is pressed.
mouseDragged() block does the same when the mouse button is pressed
p. 266
Easing, also called interpolation, is a technique for moving between two points.
As the shape approaches the target position, the distance moved each frame decreases.
The easing variable sets the fraction of the distance between the circle’s current
position and the position of the mouse that the circle moves each frame.
between 0.0 and 1.0,
The value of this variable changes how quickly the circle will reach the target.
An easing value of 0.5 means the circle will move half the distance each frame and an
easing value of 0.01 means the circle will move one hundredth of the distance each
frame.
標籤:
496512649 怯婷芳,
HW06
2010年10月28日 星期四
HW06: Image Animating Application
HW06-1:
1.
Images are colored with the tint() function. This function is used the same way as
fill() and stroke(), but it affects only images:
tint() //單一顏色遮罩住圖片,可以做出淡入淡出效果
noTint() //把tint關掉
2.讓圖片移動
就是讓 image(photo, x, y)裡的X和Y做增加或遞減
HW06-2: Coordinate system translation
translate(x, y) //平移系統座標
rotate(angle) //旋轉座標,逕度非角度,會順時鐘旋轉,且角度會一直累積,到2PI會回到原點
HW06-3: Easing Motion
創造一個球,跟著滑鼠跑,之後增加跟屁蟲XD
x1 += (mouseX- x1) * easing; //easing是一個參數,設定跟緊的程度
y1 += (mouseY- y1) * easing;
HW06-4: Storing mouse data in Arrays
把滑鼠座標存在陣列裡,之後複製前一個球等於下個球的位子
for (int i = num-1; i > 0; i--)
{
x[i] = x[i-1];
y[i] = y[i-1];
}
HW06-2: Coordinate system translation
translate(x, y) //平移系統座標
rotate(angle) //旋轉座標,逕度非角度,會順時鐘旋轉,且角度會一直累積,到2PI會回到原點
![]() |
| 會動的電風扇 |
HW06-3: Easing Motion
創造一個球,跟著滑鼠跑,之後增加跟屁蟲XD
x1 += (mouseX- x1) * easing; //easing是一個參數,設定跟緊的程度
y1 += (mouseY- y1) * easing;
HW06-4: Storing mouse data in Arrays
把滑鼠座標存在陣列裡,之後複製前一個球等於下個球的位子
for (int i = num-1; i > 0; i--)
{
x[i] = x[i-1];
y[i] = y[i-1];
}
補充: keyPressed //按鍵觸發布林事件
心得:
這次做得東西都和使用者互動有關係,不再是死死的程式,是生動活潑的!
我非常歡這樣的課程,希望能把這些所學應用到專題上。
訂閱:
文章 (Atom)












