2008年5月30日 星期五

2008年5月26日 星期一

Rule 184~

該說CA還真是神奇~
藉著'1'和'0'的組合,
就能畫出張圖~
這些組合有點規則性,
感覺上'1'好像是白色,'0'則是黑色~

改變許多1和0的排列
就有不同的效果~

HW14-1:細胞自動機

我的圖: http://www.pinkpaper.info/.png 程式碼: http://www.pinkpaper.info/.htm 網頁版: http://www.pinkpaper.info/.html 按下滑鼠任一鍵可以重新產生。

Rule 184

這次的講義進度是Rule 184?

那個很像金字塔的圖
只要變動一個數值1或0,圖案就會變動很多
跟之前畫的圖不太一樣
指令變得很複雜,已經不像是一開始寫的程式一樣那麼顯而易懂
需要研究的還有很多
後面的程式,細胞分裂,感覺很像變形蟲
他的演化可以是很多種
有,聚集ˋ分裂ˋ變大或變小之類的方式可以用
不過我還不是很熟
光是修改一些東西試試看,就一直有BUG
其實我的程式真的不是很厲害
要學的還有很多@@

Abuot〝Rule 184〞

講到〝細胞分裂〞,一開始想到的一定是跟醫療有關的東西,
沒想到這次卻是另一種演算法,而且拿來作畫!!
真的很特別!!

〝0〞與〝1〞就好比是一個開關,或是說控制碼
0和1顯示著相反的東西,
利用0與1的排序,就可以規律的畫出一張圖!

如此一來我們不用像第一次寫程式繳交的圖片一樣,
一行一行指令寫下來,
只要找到規則,
就可以用程式碼跑出一張圖,
不過要懂這個...需要一點時間!!!

那間上課,老實說,有懂了,可是還是有點模糊!!
一直沒有辦法完成我想要的樣子!!!
@"@ 就這樣下課了!!!! 噗~~

心得沒有很多,就這樣而已@"@a

2008年5月19日 星期一

Week14:細胞自動機的資料

細胞自動機的相關資料,中文:

http://lab.geog.ntu.edu.tw/course/%E7%A9%BA%E9%96%93%E7%9F%A5%E8%AD%98%E7%AE%A1%E7%90%86/ch12.htm

風扇

http://ss24.mcu.edu.tw/~s5360644/light/applet/index.html
目前還未完成
正在研究如何消掉風扇轉動過的痕跡
上禮拜想說作完成後再交
結果沒給學姊登記到
希望老師至少能給我個風扇圖案的分數><


目前還未完成
正在研究如何消掉風扇轉動過的痕跡
上禮拜想說作完成後再交
結果沒給學姊登記到
希望老師至少能給我個風扇圖案的分數><

上次的上機考

http://www.csie.mcu.edu.tw/~s5361195/sketch_080520w/applet/index.html


因為那時候社團剛好有大活動要忙請了公假...

所以只能做這個來彌補一下了@@

遲來的一PO

http://ss24.mcu.edu.tw/~s4360415/fanner/

期中_我要電風扇

扇扇扇扇扇

呼~

雖然基本程式不難寫

但是後來要把它改比較好看一點反而比較難一點...


一開始本來想爛爛的就算了

但是看到好多人得很好看

轉得很有feel

所以就給他稍微改一下

雖然還是很爛~"~(抱歉喔)

程式碼:
float angle = 0.0;void setup() {size(600, 600);smooth();noStroke(); background(0); frameRate(1000);}void draw() {rect(0,0,100,100);stroke(255,0,128);stroke(200,0,200,200);rect(0,0,0,150);if(mousePressed != true){ background(0);strokeWeight(10);translate(300, 300);stroke(200,0,200,200);rect(0,0,0,150);stroke(200,200,0,200);line(0, 0, 60, 0);line(0, 0, -60, 0);line(0, 0, 0, 60);line(0, 0,0,-60);}if(mousePressed == true)if(mouseX<100 && mouseY<100){stroke(200,0,200,200);rect(0,0,0,150);fill(0, 12);rect(0, 0, width, height);strokeWeight(10);fill(255);angle = angle + 0.2;translate(300, 300);stroke(200,0,200,200);rect(0,0,0,150);rotate(angle);stroke(200,200,0,200);line(0, 0, 60, 0);line(0, 0, -60, 0);line(0, 0, 0, 60);line(0, 0,0,-60);}}

期中考:電風扇

我的圖: http://freehoxt.com/.png 網頁版: http://page.freett.com/.html 按左鍵開始旋轉,按右鍵可停止旋轉。 程式碼: http://my5gb.com/.htm

2008年5月16日 星期五

真是一PO三折

電腦頻頻出問題
一直到現在才可以上來PO文

http://ss24.mcu.edu.tw/~s5361036/FAN

不知道看不看的出來 兩個風扇 轉的方向不同!!!

2008年5月13日 星期二

就是差那麼一點...

http://ss24.mcu.edu.tw/~s5360405/_95360405__3

基本上一開始已經先畫出風扇了.....
但是在上課時無法變成網路版的....
所以就回家用...
結果一回家才發現我忘記存檔了....
一切重頭開始....
所以有點簡陋.......
改天會想個延伸的然後從新補上來...


這個程式一開始想讓她轉...
我想到的是直接從線的座標去改....
但是改了之後不但電腦當掉......
等到真的跑出來時發現.....
風扇越來越大了......
想了很久.....
想辦法把風扇變小...
但就是想不出來....
後來等救援時....
說課本上有程式碼
有指令可以直接讓他轉...
阿阿阿.....
一句話驚醒我夢中人阿!!!!!!
然後才有辦法讓他轉.....
所以.....
這次我想是我想太多了.....
哈哈哈...
或許下次想的簡單點反而寫的出來~

期中考-電風扇

http://mail.csie.mcu.edu.tw/~s5361045/applet1
其實做出電風扇不難,用之前花的來改就好了。
只是讓它轉就真的是非常的難了..............
剛開始還用亂數,不過他跳來跳去的根本就不像是在轉=.=
後來想到用有規律的變數來控制風扇的旋轉角度,終於就做出來了!

電扇

被救援 然後自己亂用=_=



很想把原本的圖的風扇拿來轉



可是原本的圖直接轉會整個洗成圓= =



只好跑一次底畫一次電扇!?



用到最後按鈕後畫面直接跳到畫底畫電扇…



按鈕還要一直按著>_<



所以現在PO的是我把按鈕判斷地方消掉的…

網頁

其中-電風扇

http://ss24.mcu.edu.tw/~s4363090/design/02/index.html
其中最難的就是讓風扇轉動,所以想了很久才做出來。

電風扇

http://ss24.mcu.edu.tw/~s4361082/sketch_080513a/applet/index.html

風扇~''~




旋轉吧!!

float angle = 0.0;
void setup()
{
size(500, 500);
background(255);
smooth();
fill(0);
ellipse(200, 200, 120, 120);
fill(255);
ellipse(200, 200, 115, 115);
fill(0);
rect(195,260,10,100);
}

void draw()
{
dr();
}

void dr()
{
float r,g,b;
r=0;
g=0;
b=0;
noStroke();
fill(r,g,b);
rect(300,350,50,50);
if(mouseX>300 && mouseX<350 && mouseY>350 && mouseY<400)
if (mousePressed == true)
{
fill(168);
rect(300,350,50,50);
translate(200, 200);
stroke(255,0,0);
for (int i = 0; i < 10; i++)
{
rotate(angle);
angle = angle + 0.03;
strokeWeight(1);
rotate(PI/2);
fill(255);
ellipse(0, 0, 110, 25);


rotate(angle);
angle = angle + 0.01;
strokeWeight(1);
rotate(PI/2);
fill(255);
ellipse(0, 0, 110, 25);

fill(255);
ellipse(0, 0, 33, 33);

}
}

}

電風扇

http://ss24.mcu.edu.tw/~s5361143/applet4/

上機很緊張,
我想最重要的指令就是rotate吧!
還有background把他打在迴圈裡,
才不會重複出現之前的圖案!
延伸...回家再好好想想XD

期中考

float angle = 0.0;
void setup() {
size(800, 600);
background(0);
smooth();

}
void draw() {
background(0);
fill(255);
rect(300,500,50,50);
stroke(255,0,0,200);
line(510,550,510,330);
if (mousePressed == true) {
angle = angle + 0.5;
translate(510,330);
rotate(angle);
strokeWeight(15); // Increase stroke weight
for (int i = 0; i < 30; i++) {
strokeWeight(10);
rotate(PI/15);
stroke(0,0,255,200);
line(50, 50, 50,0);
strokeWeight(20);
rotate(PI/30);
stroke(0,255,0,200);
line(20, 20, 40,0);
strokeWeight(20);
rotate(PI/30);
stroke(255,0,0,200);
line(10, 10, 20,0);
}
}
else
{
strokeWeight(15); // Increase stroke weight
translate(510, 330);
for (int i = 0; i < 30; i++) {
strokeWeight(10);
rotate(PI/15);
stroke(0,0,255,200);
line(50, 50, 50,0);
strokeWeight(20);
rotate(PI/30);
stroke(0,255,0,200);
line(20, 20, 40,0);
strokeWeight(20);
rotate(PI/30);
stroke(255,0,0,200);
line(10, 10, 20,0);
}}}
http://ss24.mcu.edu.tw/~s5360094/fan

卡住的部份在於,只會旋轉一次
還有沒有把前面的部份清掉...

最後...還是只有解決第一個問題
不過算是有點偷吃步吧....

期中考~風扇

http://ss24.mcu.edu.tw/~s5360475/95360475_1234

float angle = 0.0;
void setup()
{
size(500,500);
background(255);
smooth();
fill(0,0,0);
rect(0,0,50,50);
}
void draw()
{
if (mouseX<50 && mouseY<50)
{
if (mousePressed == true)
{
rect(250, 50,3,500);
translate(250,140);
for (int i = 0; i<10;i++)
{
rotate(angle);
stroke(0,255,0);
strokeWeight(30);
line(0,0,80,0);
angle = angle + 0.01;
rotate(angle);
strokeWeight(2);
fill(0);
angle = angle + 0.03;
ellipse(0, 0, 200, 20);
fill(0);
ellipse(0, 0, 50, 50);
fill(255);
}
}
}
}



我覺得這個考試
最難的地方
應該就是
讓它轉吧
讓它轉是向別人求救
才出來的

風扇

float angle = 0.0;
void setup() {
size(800, 600);
background(255,255,255);
smooth();
}
void draw(){
background(255,255,255);
smooth();
stroke(255,0,0);
translate(300, 300);
line(2,50,2,100);
angle = angle + 0.02;
rotate(angle);

for( int i=0;i<24;i++)
{
smooth();
line(50, 0, 10, 0);
rotate(PI/2);
strokeWeight(10);
stroke(350,50,50);


ellipse (0,0,50,50);
}
}




只能這樣囉

先PO程式碼

float angle = 0.0;void setup(){background(0);size(600,600);smooth();stroke(255, 120);strokeWeight(8);line(300, 300, 300, 600);
}
void draw(){/*background(0);translate(300, 300); // Set initial offsetfor (int i = 0; i < 50; i++) { // 18 repetitionsstrokeWeight(i/2); // Increase stroke weightrotate(PI/2); // Accumulate the rotationline(0, 0, 100, 0);stroke(255,125,200);fill(255);ellipse(0,0,50,50);}*/
if(mouseButton == LEFT) {angle = angle + 0.02;translate(300, 300);rotate(angle);for (int i = 0; i < 50; i++) { // 18 repetitionsstrokeWeight(i/2); // Increase stroke weightrotate(PI/2); // Accumulate the rotation line(0, 0, 100, 0);stroke(255,125,200);//background(0);
}
}
}


先PO程式碼= =
等我回家修改過後在把網路版的PO上來

風箏

http://ss24.mcu.edu.tw/~s5360290/95360290/
float angle = 0.0;void setup() {size(600, 400);smooth();noStroke();}void draw() {rect(0, 0, width, height);fill(0,0,0);rect(0, 0, 50, 50);fill(128,123,111);line(100,100,100,250);fill(255);translate(100, 100);for (int i = 0; i < 4; i++) { strokeWeight(18); rotate(PI/2); stroke(180,180,180,180); line(0, 0, 55, 0); }if(mousePressed == true) dr();}void dr(){ if(mouseX<50 && mouseY<50){ //background(255); line(0,0,0,150); angle = angle + 0.01; rotate(angle); for (int i = 0; i < 4; i++) { strokeWeight(18); rotate(PI/2); stroke(180,180,180,180); line(0, 0, 55, 0); } }}

電扇

http://stu.csie.mcu.edu.tw/~s5360564/turn/

最難的是轉的部份吧,弄了快兩節課終於會轉了。

期中"電風扇"

float angle = 0.0;
void setup()
{
size(400,400);
smooth();
noStroke();
}
void draw() {
fill(132,81,151);
rect(0,0,50,50);
if(mouseX<50 && mouseY<50)
if (mousePressed == true)
{
fill(255,0,128);
rect(190,250,20,120);
fill(0,0,255);
ellipse(200, 200, 15,15);
fill(40,50);
rect(0, 0, width, height);
fill(255,0,0);
angle = angle + 10.0;
translate(200,200);
rotate(angle);
rect(-50,-10,50,10);
}
}

風扇

http://www.csie.mcu.edu.tw/~s5361116/pro/applet/index.html
按鈕尚未解決

期中

http://ss24.mcu.edu.tw/~s5360813/index.html

電風扇 按ㄌ會動

float angle = 0.0;
void setup(){size(800,600);frameRate(15);}void draw(){ background(255,255,255); translate(400,300); ellipse(0, 0,100,100); fill(0,100,0); line(0, 50, 0, 200); angle=angle+0.2; rotate(angle); draw2();}void draw2(){ { translate(-100,0); ellipse(0, 0,100,60); fill(100,100,0); } { translate(200,0); ellipse(0, 0,100,60); fill(10,100,100); } }

風扇

http://www.csie.mcu.edu.tw/~s5360352/fans/
float angle = 0.0;
void setup() {
size(300, 400);
background(0,0,255);
strokeWeight(3);
rect(150,200,0,200);
strokeWeight(0);
fill(255,255,0);
rect(0,0,50,50);
}
void draw() {
if(mouseX<50 && mouseY<50)
{
if (mousePressed == true){
translate(150, 200);
for( int i=1;i<3;i++)
{
angle = angle + 0.05;
rotate(angle);
strokeWeight(10);
stroke(255,0,0,100);
line(0, 20, 50, 0);
angle = angle + 0.03;
rotate(angle);
strokeWeight(10);
stroke(0,0,0,100);
line(0, 0, 50, 0);
}
}
}
}
一開始很快就做出風扇,但是不會轉,直道跟同學求救,才知道要加上角度的變數,才可以使風扇轉動

我的風扇

http://www.csie.mcu.edu.tw/~s5361170/0051/index.html


這次的上機考有點小緊張,
畫一個電扇的語法還算ok
之後要讓她動就有點難倒我了!

後來看老師的講義備我翻到,
了解用法,
帶進去~
他就轉勒~

酷,有點成就感^^
float angle = 0.0;void setup(){size(800, 600);background(0);smooth();noStroke();}void draw(){
rect(50,50,80,80);if(mousePressed==true){ fill(0,225,0,10); ellipse(400,300,380,380); fill(225,0,0); rect(400,490,20,200); fill(0,12);ellipse(0,0, width,height);rect(0, 0, width, height);rect(0, 0, width, height);fill(225);angle = angle + 0.02;translate(400, 300);rotate(angle);ellipse(-30,-30,100,100); rect(-40,-180,20,300); rect(-180,-40,300,20);
}
}

電風扇

http://ss24.mcu.edu.tw/~s5360015/applet/

原本我想用上次的作業改
但我這種想法是錯的
因該還要加入新的程式碼才會比較好

期中考阿~電風扇

我的電腦沒辦法用成網路版~等等再用囉~
先放程式碼,很亂

float angle = 0.0;
void setup(){
size(400,300);
background(0);
}
void draw(){
rect(195,150,10,60);
rect(180,210,40,10);
rect(210,200,10,10);
translate(200, 150);
fill(255,100,190,80);
ellipse(0,0,70,10);
ellipse(0,0,10,70);
if ((mouseX > 210) && (mouseX <> 200) && (mouseY < 210)) {
if (mouseButton == LEFT) {
for (int i = 0; i <15; i++) {
rotate(PI/10);
angle = angle+0.0002;
ellipse(0,0,70,10);
rotate(angle);
}
}
}
}

上機考之電風扇(?)

http://ss24.mcu.edu.tw/~s5360626/applet12/index.html


偷吃步的....XD

電扇

http://www.csie.mcu.edu.tw/~s5361170/0414/index.html
這次電風扇原本我是用花去改的

但只能變顏色

後來改成旋轉但有重疊下來的痕跡

後來把background和LOOP一起跑就解決了

電風扇上機考

上機考的電風扇
最難的部份? ...
嗯 ... 應該是電風扇的弧形葉面太難畫了,畫不出來結果放棄妥協了 = =a

延伸部分:
目前想到的是電風扇跟著滑鼠跑,上面有很多葉子,被電風扇吹到的會飛走
快寫出來囉,寫出來之後在放上去嚕

電風扇

http://www.csie.mcu.edu.tw/~s4360786/test1/index.html

程式碼:http://www.csie.mcu.edu.tw/~s4360786/1.txt

電風扇

  1. http://ss24.mcu.edu.tw/~s5360626/applet/index.html

最難的應該是讓她旋轉的指令八

偷吃步之殘影運用

http://www.csie.mcu.edu.tw/~s5361170/good/index.html


======================================

我覺得這次最難的部份是電扇的運作方式吧

可以有許多不同的方式來詮釋電扇的轉動

有留下殘影的

兩張圖相互交換的

一起移動同樣間距的

這都可以詮釋電扇

我的延伸是節省資源 利用最少物件來達成最大效益

2008年5月12日 星期一

期中考~風扇

http://ss24.mcu.edu.tw/~s5361143/applet3

小小花型電風扇~

http://ss24.mcu.edu.tw/~s5360954/ap
按著左鍵就轉,按著右鍵就停~
最麻煩的是,明明知道它有在轉,可是眼睛卻看不出來啊~
我讓它轉的圈數隨機換,這樣就看得出來了.
{ size(400, 400); background(255); smooth(); }void draw(){ int i,k=0; smooth(); translate(200, 200); stroke(0,0,0); strokeWeight(10); line(0,0,0,160); for(i=0;i<4;i++){ stroke(255-i*40,0,0); strokeWeight(5); line(0, 0, 80,0); rotate(PI/2); } if (mousePressed == true) k+=1; if((k%2) == 1){ for(i=0;i<16;i++){ stroke(255-i*10,0,0); rotate(PI/8); line(0, 0, 80,0); } }}

這次的考試
其實就掌握幾個重要的程式碼
應該就可以做的出來了

translate 物件位置
stroke 填充顏色
rotate 旋轉角度

點到哪就開花~

http://ss24.mcu.edu.tw/~s5361143/applet6/

花~

void setup()
{size(800, 800);
background(255);
smooth();
}
void draw()
{smooth();if (mousePressed == true){translate(mouseX, mouseY);
for (int i = 0; i < 50; i++) {strokeWeight(5);rotate(PI/15);
stroke(random(0,255),random(0,255),random(0,255),200);
line(0, 0, 80,0);
}
}
}

HW12-1:圖形的變換、位移、旋轉

我的圖: http://freehoxt.com/.png 網頁版: http://page.freett.com/.html 按滑鼠左鍵可增加十朵,右鍵可消除全部。 程式碼: http://my5gb.com/.htm

0506之2的延伸

http://www.csie.mcu.edu.tw/~s5361195/sketch_080512a/applet/index.html


不管怎麼看都是鬥雞眼的外星人~

儘管你驚訝~突出了雙眼~你還是鬥雞眼~

還能跟她玩123木頭人~看他看到甚麼東西會嚇的臉色發青~

延伸

http://www.csie.mcu.edu.tw/~s5361214/drawdraw/applet/index.html


這...我也不知道是什麼@@
只是想說丟了一個ROTATE進去就變成這樣
雖然有點怪
可是我還滿喜歡這種感覺XDDD
有點像潑墨,哈哈

2008年5月11日 星期日

距離~變化

http://ss24.mcu.edu.tw/~s5361143/applet7

2008年5月8日 星期四

void setup() {
size(600, 600);
background(0);
smooth();
}
void draw(){
smooth();
if (mousePressed == true){
translate(mouseX, mouseY);
for (int i = 0; i < 30; i++) {
strokeWeight(10);
rotate(PI/15);
stroke(0,0,255,200);
line(50, 50, 50,0);

strokeWeight(20);
rotate(PI/30);
stroke(0,255,0,200);
line(20, 20, 40,0);

strokeWeight(20);
rotate(PI/30);
stroke(255,0,0,200);
line(10, 10, 20,0);
}
}
}

2008年5月6日 星期二

Recursuve


網頁版:
http://ss24.mcu.edu.tw/~s5360954/cir

花2


void setup() {
size(500, 500);
background(255);
smooth();
}
void draw(){
smooth();
translate(mouseX,mouseY); // Set initial offset
if (mousePressed == true) {
for (int i = 0; i < 25; i++)
{
strokeWeight(5); // Increase stroke weight
rotate(50);// Accumulate the rotation
stroke(random(0,255),random(0,255),random(0,255));
line(6, 1, 50, 50);
}
}
}

花?畫?

http://ss24.mcu.edu.tw/~s5361214/flower/applet/index.html

奇怪花




void setup()
{
size(800,600);
background(0);
}
void draw()
{
}
void mousePressed()
{
smooth();
stroke(1, 10);
translate(mouseX, mouseY); // Set initial offset
float x=random(0,200);
fill(255,x,x);
for (int i = 0; i < 18; i++) { // 18 repetitions
strokeWeight(i); // Increase stroke weight
rotate(PI/5); // Accumulate the rotation
fill(random(100,255),random(100,190),random(100,190));
ellipse(0,0,60,10);
}
}


===============================================================

奇怪的花

花!!!

void setup() {
size(800, 800);
background(255);
smooth();
}
void draw(){
smooth();
if (mousePressed == true){
translate(mouseX, mouseY);
for (int i = 0; i < 24; i++) {
strokeWeight(10);
rotate(PI/12);
stroke(random(0,255),random(0,255),random(0,255),200);line(0, 0, 60,0);
}
}
}

灑小花


這些小花,我很想讓他"點到為止",但是他只要按著不放就會暴走
所以還再想讓她點一下出現一朵的狀態

福老耳...GOOD
















void setup() {
size(800, 600);
background(0);
smooth();
}

void draw()
{
if (mousePressed == true) {

stroke(255,150,55);

translate(mouseX,mouseY);
for (int i = 0; i < 10; i++) { // 18 repetitions
strokeWeight(15); // Increase stroke weight
rotate(PI/4); // Accumulate the rotation
line(5,5,20, 25);
}}}

花!!


void setup(){
size(600,600);
background(0);
smooth();
stroke(255,120);
}
void draw(){
if (mousePressed == true){
translate(mouseX, mouseY);
for (int i=0;i<25; i++)
{
strokeWeight(i);
rotate(PI/12);
line(0, 0, 100, 0);
stroke(random(0,255),random(0,255),random(0,255),180);
fill(random(0,255),random(0,255),random(0,255),180);
triangle(30,40,20,50,60,20);
}
}
}






void setup() {
size(200, 200);
background(255);
smooth();
noLoop();
}
void draw(){
smooth();
translate(99, 99); // Set initial offset
for (int i = 0; i < 25; i++) { // 18 repetitions
strokeWeight(5); // Increase stroke weight
rotate(50);// Accumulate the rotation
stroke(random(0,255),random(0,255),random(0,255));
line(6, 1, 50, 50);
}
}

Flower



Code:
void setup()
{
size(800,600);
background(255);
}
void draw(){}
void mousePressed()
{
smooth();
stroke(random(0,255),random(0,255),random(0,255), 120);
translate(mouseX, mouseY); // Set initial offset
for (int i = 0; i < 12; i++) { // 18 repetitions
strokeWeight(50); // Increase stroke weight
rotate(PI/6); // Accumulate the rotation
line(0,0,55,0);
}
ellipse(0,0,30,30);
}

第2朵花

void setup() {
size(300, 400);
smooth();
}
void draw ()
{
translate(mouseX,mouseY);
smooth();
if (mousePressed == true) {
for( int i=0;i<24;i++)
{
rotate(PI/6);
strokeWeight(7);
stroke(random(0,255),random(0,255),random(0,255),50);
line(0, 0, 20, 0);
}
}
}

花非花!!



種花!


void setup()
{
size(400, 600);
background(255);
smooth();
}
void draw()
{

dr();
}
void dr()
{
float r,g,b;
r=random(0,255);
g=random(0,255);
b=random(0,255);
if (mousePressed == true)
{
translate(mouseX, mouseY);
stroke(r,g,b,120);
for (int i = 0; i < 20; i++)
{
strokeWeight(10);
rotate(PI/8);
line(0, 0, 50, 0);
ellipse(0, 0, 15, 15);

}
}
}


size(800,600);
background(255);
smooth();
translate(400, 300);
for (int i = 0; i<30;i++){
stroke(random(255,255),random(0,160),random(128,255));
strokeWeight(i);
rotate(PI/5);
line(0, 0, 55, 0);
}




void setup(){
size(800,600);
background(255);
smooth();
translate(400, 300);
}
void draw(){
if (mousePressed == true)
{
translate(mouseX,mouseY);
for(int i=0;i<30;i++){
stroke(random(255,255),random(0,160),random(128,255));
strokeWeight(i);
rotate(PI/5);
line(0, 0, 55, 0);
}
}
}

flower

http://ss24.mcu.edu.tw/~s5360626/flow/applet/index.html

花花花花花花

void setup()
{
size(800, 600);
background(0);
smooth();
}
void draw()
{smooth();
if (mousePressed == true)
{
translate(mouseX, mouseY);
for (int i = 0; i < 18; i++)
{strokeWeight(25);
rotate(PI/9);
stroke(random(25,255),random(25,255),random(25,255),255);
line(0, 0, 55,55);
ellipse(0,0,60,60);
}
}
}

很多花


size(800,600);
background(0);
smooth();//stroke(255, 120);
for(int j=0;j<=1000;j++)
{
translate(random(10,320) ,random(10,320));// Set initial offset
for (int i = 0; i <25>
{ // 18 repetitions
stroke(random(50,190),random(50,200),random(50,190));
strokeWeight(i); // Increase stroke weight
rotate(PI/4); // Accumulate the rotation
line(0, 0, 32, 0);
}
}

這不是花




















好醜的一朵花




















好多很醜的花

點哪裡都會跑出很醜的花

花-自點


程式碼:
void setup(){
size(800,600);
background(0);
}
void draw(){
for(int i=0;i<50;i++)
{
float x,y;
float a1,a2,a3,a4;
a1=random(0,255);
a2=random(0,255);
a3=random(0,255);
a4=random(0,255);
x=random(0,800);
y=random(0,600);
if (mousePressed == true)
{
smooth();
stroke(a1,a2,a3,a4);
translate(mouseX, mouseY);
// translate(x,y); // Set initial offset 座標
for (int j = 0; j <50; j++)
{
strokeWeight(j); // Increase stroke weight
rotate(PI/6); // Accumulate the rotation
line(0, 0, 55, 17);
}
}
}
}



void setup()
{
size(400, 400);
background(30,150,0);
smooth();
}
void draw(){
translate(mouseX,mouseY); // Set initial offset
if (mousePressed == true){
for (int i = 0; i < 30; i++)
{ // 18 repetitions
strokeWeight(7); // Increase stroke weight
rotate(PI/12); // Accumulate the rotation
stroke(random(0,255),random(0,100),random(0,100),random(150,180));
line(0, 0, 30, 0);
}
}
}

2008年5月5日 星期一

這是花?


void setup(){
background(0);
size(600,600);
smooth();
stroke(255, 120);
} void draw(){
if (mousePressed == true){
translate(mouseX, mouseY); // Set initial offset
for (int i = 0; i < 50; i++) { // 18 repetitions
strokeWeight(i/2); // Increase stroke weight
rotate(PI/12); // Accumulate the rotation line(0, 0, 100, 0);
stroke(random(0,255),random(0,255),random(0,255),random(0,200));
fill(random(0,255),random(0,255),random(0,255),random(0,200));
ellipse(0,0,50,50);
}
}
}

康乃馨

網頁:http://ss24.mcu.edu.tw/~s4360786/flower/

程式碼:
void setup()
{
size(800,600);
background(0);
}
void draw()
{
}
void mousePressed()
{
smooth();
stroke(1, 10);
translate(mouseX, mouseY); // Set initial offset
float x=random(10,150);
fill(255,x,x);
for (int i = 0; i < 18; i++) { // 18 repetitions
strokeWeight(i); // Increase stroke weight
rotate(PI/4.8); // Accumulate the rotation
ellipse(0,0,60,10);
}
fill(255,190,190);
ellipse(0,0,5,5);
}

花0.0

http://ss24.mcu.edu.tw/~s5360094/flower

1個花

void setup() {
size(300, 400);
//if (mousePressed == true) {
translate(150, 200);
for( int i=0;i<24;i++)
{
smooth();
line(50, 10, 10, 0);
rotate(PI/6);
strokeWeight(10);
stroke(random(0,255),random(0,255),random(0,255),300);
}
}

我點~


code:
void setup(){size(800,600);background(255,255,200);smooth();stroke(255, 120);}
void draw(){ if(mousePressed==true){
translate(mouseX,mouseY);for (int i = 0; i < 20; i++) {fill(255,150,150);rotate(PI/12); ellipse(0, 0, 50, 5);}ellipse(0, 0, 10, 10);}
}

Flower_滑鼠點



void setup(){

size(800,600);

background(0);

smooth();

}

void draw(){

stroke(255, 120, random(0,255), 100);

translate(mouseX, mouseY);

if(mousePressed == true)

{

for (int i = 0;i <>{

strokeWeight(10);

rotate(PI/12);

line(0, 0, 40, 10);

}

for (int i = 0;i <>{

stroke(255, 255, 0);

strokeWeight(10);

rotate(PI/12);

line(0, 0, 5, 0);

}

}

}

只有一朵的花
隨著滑鼠點擊,可以增加圖片數量。
float R;
float G;
float B;
float L;
void setup() {
size(800,800);
background(255);
smooth();
stroke(200, 50);
}
void draw(){
if (mousePressed == true){
translate(mouseX, mouseY); // Set initial offset
for (int i = 0; i <>
R=random(0,255);
G=random(0,255);
B=random(0,255);
L=random(10,200);
stroke(R,G,B,20);
strokeWeight(10); // Increase stroke weight
rotate(PI/143); // Accumulate the rotation
line(0, 0, L, 0);
}}}


程式碼:
size(800,600);
background(128);
smooth();
stroke(125,53,30,60);
translate(150, 200);
{ for (int i = 0; i <50;>
strokeWeight(i); // Increase
rotate(PI/6); // Accumulate the rotation
line(0, 0, 55, 17); }

花? part 2




我找不到滑鼠離開的方法,所以變成這副德性

void setup() {
size(800, 600);
background(255);
smooth();
}

void draw(){
if (mousePressed == true)
re_todo(mouseX,mouseY);
}

void re_todo(int x,int y){
smooth();
translate(x, y); // Set initial offset
for (int i = 0; i < random(3,25); i++) { // 18 repetitions
strokeWeight(random(3,18)); // Increase stroke weight
rotate(PI/5); // Accumulate the rotation
stroke(random(0,255),random(0,255),random(0,255),180);
line(0, 0, random(15,55), 0);
}
}

小紅花~


code:
size(800,600);background(255,255,200);smooth();stroke(255, 120);float k;for(int j = 15; j < 100; j++){k=random(50,75)+j;translate(2*k,3*k+10);for (int i = 0; i < 20; i++) {fill(255,150,150);rotate(PI/12); ellipse(0, 0, 50, 5);}}

0506一堆花





想辦法均勻散佈中...

程式碼:

void setup(){size(800,600);background(255,255,255);smooth();noLoop();}
void draw(){ for(int j=0;j<100;j++){ translate(random(-50,100),random(-50,100));fill(random(150,255),random(150,255),random(150,255),255);ellipse(-35, -5, 70, 10);for(int i=0;i<180;i++){ rotate(-PI/10);fill(random(150,255),random(150,255),random(150,255),255);ellipse(-35, -5, 70, 10);}fill(random(150,255),random(150,255),random(150,255),255);ellipse(0, 0, 60, 60);} }

-----------------------------------------


void setup() {size(800, 600);
}void draw() { } // Empty draw() keeps the program runningvoid mousePressed() {float xx=random(0,100),yy=random(0,20);translate(mouseX,mouseY);fill(random(150,255),random(150,255),random(150,255),255);ellipse(-xx/2, -yy/2, xx, yy);for(int i=0;i<180;i++){ rotate(-PI/10);fill(random(150,255),random(150,255),random(150,255),255);ellipse(-xx/2, -yy/2, xx, yy);}fill(random(150,255),random(150,255),random(150,255),255);ellipse(0, 0, xx, xx);
}