2008年4月29日 星期二

小小小畫家<網路版>

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

這是後來回家完成的
不僅顏色變多了
還加上了可以自由選擇畫筆粗細的功能
然後 右下角 很明顯是個儲存的按鈕!!!

aaa

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

2008年4月28日 星期一

小小小小畫家

網路硬碟分享:1036

超~ 簡易小畫家




code :
int R = 0;
int G = 0;
int B = 0;

void setup() {
size(600, 400);
background(255);
smooth();
}
void draw() {
if (mousePressed == true) {
strokeWeight(2);
stroke(R,G,B);
line(mouseX, mouseY, pmouseX, pmouseY);
}

//選畫板
dr();
}

void dr(){
//--黃色
strokeWeight(0);
fill(255,255,0);
rect(0,350,50,50);
if(mouseX<50 && mouseY>350)
if (mousePressed == true){
R=255;G=255;B=0;
}
//--紅色
fill(255,0,0);
rect(50,350,50,50);
if(mouseX<100 && mouseX>50 && mouseY>350)
if (mousePressed == true){
R=255;G=0;B=0;
}
//--藍色
fill(0,0,255);
rect(100,350,50,50);
if(mouseX<150 && mouseX>100 && mouseY>350)
if (mousePressed == true){
R=0;G=0;B=255;
}
//--綠色
fill(0,255,0);
rect(150,350,50,50);
if(mouseX<200 && mouseX>150 && mouseY>350)
if (mousePressed == true){
R=0;G=255;B=0;
}
}

看滑鼠

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

滑鼠

http://ss24.mcu.edu.tw/~s5360644/_989898/applet/index.html

qwer

最新 連結

目前只做到這樣

未來希望能夠把車子也會跟著轉方向跑

不過似乎有點給他有難度~

Doraemon&銅鑼燒

因為自己的電腦沒有辦法用Processing
所以只好等到現在我室友跑去洗澡了
才用他的電腦 哈哈哈XD

在我完成這個小叮噹的時候 有人給了我建議
叫我也畫上銅鑼燒讓他的眼睛跟著銅鑼燒跑
所以我又再加上了銅鑼燒 可是加上銅鑼燒的時候
他會一直在背景上不斷的畫銅鑼燒
但是如果我重新取背景的顏色的話
這樣我的小叮噹會不見的
所以後來的解決方式呢 背景所看到的黃色的底
是我畫了一個很大的方形(就是800*600的啦)

當我再度完成的時候
居然每個看過的人都說
我應該設計 當銅鑼燒經過嘴吧的時候
銅鑼燒要被吃掉 @"@
分明是欺負我電腦不能寫程式嘛
等我可以寫的時候 再讓銅鑼燒消失吧!!!!

http://ss24.mcu.edu.tw/~s5361036/95361036_Doraemon

HW0801、HW0901:圓形方陣的延伸應用、滑鼠事件

我的圖: http://i193.photobucket.com/albums/z170/.png 主題:心之雨 涵意說明: 不斷出現、消失的彩色圓圈代表一點點的雨滴,不同色彩的雨滴代表我們的心對於不同事物的感受、想法; 灰色、可用滑鼠控制位置的圓圈是雨傘,當以此圓圈碰觸其他彩色之圓圈時,彩色圓圈將消失。 灰色代表我們對於某些厭惡或不願面對的事物常抱著負面的想法,想去迴避它(以灰傘遮蔽)。 網頁版: http://page.freett.com/.html 程式碼: http://99k.org/.htm 以Processing執行時,按滑鼠左鍵可加快落雨速度、右鍵可減慢速度、中鍵可恢復預設速度。

小畫家畫的 and processing畫的

processing 畫的 -->>






小畫家 畫的 -->>



size(800,600);
background(255);
fill(138,138,138);
triangle(236,165,271,209,244,253);
fill(138,138,138);
triangle(244,253,195,275,244,288);
fill(0,0,0);
ellipse(350,280,216,216);
fill(255,255,255);
ellipse(305,260,130,130);
fill(138,138,138);
ellipse(285,255,20,30);
fill(138,138,138);
rect(325,383,42,30);
fill(0,0,0);
ellipse(345,470,155,155);
fill(0,0,0);
line(204,545,501,545);
fill(0,0,0);
quad(330,545,309,585,398,585,370,545);
fill(138,138,138);
ellipse(335,535,41,50);
fill(138,138,138);
ellipse(378,535,41,50);





2008年4月16日 星期三

有滑鼠的作業

http://ss24.mcu.edu.tw/~s4363613/wd/ep_02

不小心竟然做成遊戲了- -a

要考試就先寫到這,之後再看看要補什麼...

考完可能會寫成打磚塊也說不定 囧

規則:時間愈久,速度愈快,版子愈小
(板子不會小到不見,速度有上限不會快到看不見)

2008年4月15日 星期二

圓形方陣+滑鼠

http://ss24.mcu.edu.tw/~s5360954/app
顏色會跟著滑鼠座標做改變~

mix

ss

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

網頁版

http://ss24.mcu.edu.tw/~s4363090/design/01/index.html

void setup(){
size(800,600);
frameRate(5);
}
void draw(){
for (int y = 0; y < 600; y += 100)
{
for (int x = 0; x < 800; x += 100)
{
for (int z = 100; z>=0 ; z-=25)
{
fill(random(255),random(255),random(255),random(100));
ellipse(x+50, y+50, z, z);
}
}
}
}

網頁

http://ss24.mcu.edu.tw/~s5360831/95360831/

網頁版

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

網頁版

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

網頁

http://www.csie.mcu.edu.tw/~s5360352/95360352/

圓型方陣


size(800,600);
noStroke();
for (int y = 0; y < 600; y += 100)
{
for (int x = 0; x < 800; x += 100)
{
for (int z = 100; z>=0 ; z-=25)
{
fill((x+y+z*2) * 0.3,(x+y+(z*8)) * 0.2,(x+y+(z*2)) * 0.2);ellipse(x+50, y+50, z, z);
}
}
}

2008年4月14日 星期一

會動的蝴蝶

void setup(){
size(800,600);
background(random(100,255),random(100,255),random(100,255));
smooth();
//noloop()
}
void draw(){
background(0); //覆蓋之前跑的圖形,才不會很亂
for(int j=10;j<=100;j+=30)
{
for(int i=0;i<=800;i+=150)
{
for(int k=0;k<=600;k+=120)
{
stroke(0,0,0);
strokeWeight(4);
fill(random(100,255),random(100,255),random(100,255));
bezier(40+i+mouseX,40+k+mouseY,j+100,j+200,j+200,j+300,40+i+mouseX,40+k+mouseY);
}//只更改部分的座標,才會讓翅膀(?)感覺有在動
}
}
}

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

網頁版

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

網頁版

http://ss24.mcu.edu.tw/~s5360564/95360564/

move

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

網路版

http://ss24.mcu.edu.tw/~s5360644/sketch_080415a/applet/index.html

網路版

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

隨便!!

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

畫面很小

http://ss24.mcu.edu.tw/~s5360644/sketch_080415a/applet/index.html

我要打網頁版

這是我偷劉小玲的程式碼來改的
我還偷他的FTP來上傳

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

網頁版

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

恩..

原本是想讓他向聚光燈一樣跑的....
可是.....
還沒改出來= =
有時間我會再改的
http://ss24.mcu.edu.tw/~s5360405/95360405/

網頁

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

你動到跟你跑到哪

www.csie.mcu.edu.tw/~s5361116/1090/95361090.html

網頁

http://www.csie.mcu.edu.tw/~s5361116/pro/02/index.html

他在動@@

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

網頁版

http://ss24.mcu.edu.tw/~s4363613/wd/ep_01/index.html

幾何圖形

















用小畫家做
程式:
size(800,600);
background(255,255,255);
fill(128,0,128);
rect(80,64,110,110);
fill(0,225,225);
ellipse(150,130,280,245);
fill(0,128,255);
rect(292,15,53,65);
fill(255,0,0);
rect(433,80,55,60);
fill(128,0,128);
rect(200,180,150,60);
fill(0,64,128);
rect(165,260,108,282);
fill(0,64,128);
rect(400,260,108,282);
fill(0,128,0);
rect(325,260,47,100);
fill(255,0,0);
rect(540,260,47,100);

變化





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

void draw()
{

float x;
int c = 0;
for(int j = 100 ; j<=500 ; j=j+200)
{
for(int i = 100 ; i<=700 ; i=i+200)
{
fill(random(100,250),random(100,250),random(100,250),random(30,50));
rect(i-100,j-100,200,200);
fill(random(100,250),random(100,250),random(100,250),random(30,50));
ellipse( i , j , 200 , 200 ) ;
for(int a=0 ; a<40 ; a++)
{
noStroke();
fill(random(150,250),random(150,250),random(150,250),random(20,50));
ellipse( i , j , a*5 , a*2 ) ;
}
fill(random(0,20),random(0,20),random(0,20),random(150,200));
ellipse( i , j , 80-c , 80 ) ;
ellipse( i , j , 60-c , 60 ) ;
c = c+5;
}

}
}

圓型方陣-延伸

code:
http://ss24.mcu.edu.tw/~s5360094/ellipse_matrix.txt

色彩與雙迴圈運用


這次看到老師提供參考的色彩網站之後,我也去網路上看了許多有關色彩的教學,
每種顏色都有它的象徵與情感帶動的作用,不同的組合會帶給觀看者不同的情緒影響
。這次就使用七彩漸層,讓人有繽紛的視覺。然後在圈的外環加上白色參差,就會有立體的錯覺,再與中間的平面小點做比較,就會浮出畫面的效果了。

source code:

size(850,600);
background(0);
smooth();
colorMode(HSB);

int t=0,cir=60;
int x=100,y=50,cha=-30; //cha:錯位
while(t<7)
{
strokeWeight(1);
for(int i=0;i<8;i++)
{
strokeWeight(1);
fill(i*25, 255, 255);
ellipse(x-15,y,cir+5,cir+5); //外圈

fill(240);
ellipse(x-15,y,cir,cir); //白白色圈底

fill(i*25, 255, 255);
ellipse(x,y,cir,cir); //主圈

ellipse(x-50,y-50,10,10);
ellipse(x+50,y-50,20,20); //小點

for(int j=0;j<3;j++)
{
cir=cir-10;
strokeWeight(3);
ellipse(x,y,cir,cir); //線圈
}

x=x+100;
cir=60;
}
x=100;
if(t%2==0)
x=x+cha;

y=y+100;
t=t+1;
}

圓的聯想


資訊爆發的時代
不一的角度看待的事物
從人的頭頂看

資訊不停的直接衝擊著我們的腦袋
多彩是想表達外在誘惑
改變著每個人
人類的記憶體大小
是否足以承受這麼多的衝擊?

size(800,600);
smooth();
noStroke();

int count=0;
for(int i=300;i>=0;i-=10){
count++;

ellipse(400,300, i, i);
if(count%2==0)
fill(0);
if(count%2==1)
fill(255);

} ;

for(int i=600;i>=0;i--)
{ count++;
float k=random(0,1000);
float m=random(40);
float w1=random(180,255);
float w2=random(180,255);
float w3=random(180,255);
float w4=random(50,200);
float l=random(0,1000);
fill(w1,w2,w3,w4);
ellipse(k,l,m , m);

} ;
int a=0;

for(int x=0;x<801;x++){>

random


void setup()
{
size(800,600);
background(25,25,25);
noLoop();
}
void draw()
{
for(int i=0;i<300;i++)
{
float w,x,y,z,a,b,c,d
w = random(0,800);
x = random(0,600);
y = random(0,200);
z = random(0,200);
a= random(0,255);
b= random(0,255);
c = random(0,150);
d= random(0,150);
rect(w,x,y,z);
fill(a,b,c,d);
}
}

創意 可以吃嗎??

起跑~
















衝阿!!
















說到創意 一開始是想到用線條表示光線美
但是後來突然想到車子 就融入變成車子在跑的畫面XD
這個程式其實最難的是在畫車子 跟要做那個框框的放大
而且放大到某個程度會變難看 所以花了一點時間做
不過做完之後自己是覺得還滿有feeling的啦 XD


另外
其實我滿想把車子慢慢變小的
不過是一個格子一個格子黏的
變小的話會很難 甚至沒辦法
而且會放大的出口也可以做圓形方陣的圓形
不過方形比較有feel所以改方形了=.=
還有許多可以改進的地方..

程式碼 :
void setup(){
size(800,600);
background(0);
smooth();
frameRate(400);
colorMode(HSB);}
float i,j,m,n,r,g,b,s,p=390,t=90,q=410,z=110;
void draw(){
for(i=0;i<=10;i++) { r=random(0,255); g=random(0,255); b=random(0,255); s=random(0,255); m=random(0,800); n=random(0,600); stroke(r, g, b, s); line(400,100, m, n);} quad(p,t , p,z , q,z , q,t); //car ellipse(350,290,20,30); ellipse(448,290,20,30); quad(380,180, 350,230, 450,230, 420,180); quad(370,190, 351,220, 449,220, 430,190); quad(351,220, 350,235, 450,235, 449,220); quad(350,235, 335,270, 465,270, 450,235); quad(335,270, 335,300, 465,300, 465,270); if(t>=55) { p=p-0.08;t=t-0.06;q=q+0.08;z=z+0.06; }
}

網站連結

延伸


void setup(){size(800,600);background(255,255,255);smooth();noLoop();colorMode(HSB);
float a,b,c,d; a=random(0,100);for(int i=0;i<150;i++){ stroke(132,108,a*2.5); line(i,0,i,600); a++;} b=random(0,255);for(int i=150;i<300;i++){ b++; stroke(b*0.2,158,b*2.5); line(i,0,i,600);}
for(int i=300;i<450;i++){ b++; stroke(b*0.5,200,b*1.5); line(i,0,i,600);} c=random(30,70);for(int i=450;i<600;i++){ c++; stroke(c*3.0,100,c*1.5); line(i,0,i,600);}d=random(120,200);for(int i=600;i<800;i++){ d++; stroke(d*0.9,205,d*1.8); line(i,0,i,600);}noStroke();smooth(); for(int i=0;i<=100;i++) { for(int j=0;j<=100;j++) { float e,f; f=random(50,100); e=random(0,255); fill(e*0.3,e,a*1.2,random(40,60)); ellipse(i*15,j*15,30,30); } }
rotate(PI/random(-360,360));
}
這張圖的程式碼沒什麼技術可言,我是用較小的元配合透明度複蓋在原本不同漸層的背景上
原本的背景色差很大
但覆蓋後柔和多了。而圓圈疊起來有鱗片的感覺,圓和圓交疊後也會產生變化。

創意.........


要發揮創意......
這問題難倒我了......
基本上關於藝術方面的東西我幾乎是門外漢阿阿= =
程式碼
void setup()
{
size(800,600);
colorMode(HSB);
for (int i = 1; i <= 800; i++)
{
for (int j = 1; j <= 600; j++)
{
stroke(206, j*2.5, i*2.5);
point(i, j);
}
}
noLoop();
}
void draw()
{
stroke(random(0,255),random(0,255),random(0,255),random(50,60));
strokeWeight(5);
for(int i=800;i>=0;i-=100)
{
for(int j=0;j<=800;j+=100)
{
line(i, 0, j, 600);
}
}
}
下面網址貼的是修改過後的...
原本是想讓他向聚光燈一樣跑的....
可是.....
還沒改出來= =
有時間我會再改的

應該是孔雀吧= =


想想有甚麼東西可以用類似圓形方陣的圖來表示...
看到孔雀尾巴上的羽毛給了我這個idea...
雖然真的是看不太出來...
程式也幾乎是用暴力法寫出來的...
程式碼:

小畫家畫的 and processing畫的

小畫家
processing


size(958,608);
background(128,255,255);
fill(255,255,0);
triangle(0,0,484,608,958,0);
fill(172,131,188);
rect(123,512,712,96);
fill(181,184,135);
rect(152,430,652,82);
fill(116,118,203);
rect(177,347,599,83);
fill(230,117,89);
rect(216,270,528,77);
fill(215,218,101);
rect(242,207,468,63);
fill(118,205,114);
rect(267,145,407,62);
fill(71,141,248);
rect(314,99,339,46);
fill(65,254,140);
rect(335,60,303,39);
fill(67,252,210);
rect(433,16,113,44);
fill(252,173,67);
ellipse(487,9,26,14);

藝術白痴之作

因為沒啥藝術細胞 所以找了一張藝術大師(Vasarely)的畫來做

原圖:










CODE: //請複製執行才知道差在哪@@
void setup()
{
size(580, 560);
smooth();
noStroke();
frameRate(5);
}
void draw()
{
background(0);
fill(243,246,255);
quad(0,131,31,131,29,350,0,350);
fill(224,227,236);
quad(0,357,101,356,101,482,0,482);
fill(255);
quad(0,489,100,489,101,558,0,558);
fill(210,214,213);
quad(36,0,216,0,216,16,36,16);
fill(random(100,234),random(100,70),random(100,58));
quad(36,22,106,22,105,128,36,128);
fill(240,249,246);
quad(111,21,216,22,218,127,111,126);
fill(random(100,96),random(100,82),random(100,193));
quad(36,133,216,134,217,250,35,250);
fill(random(100,237),random(100,56),random(100,37));
quad(108,356,216,355,217,527,108,527);
fill(239,248,245);
quad(224,0,365,0,365,77,224,77);
fill(random(100,255),random(100,241),random(100,21));
quad(224,83,365,84,365,127,223,127);
fill(random(100,255),random(100,241),random(100,21));
quad(223,133,365,133,365,251,223,251);
fill(255);
quad(222,256,364,256,364,350,222,350);
fill(255);
quad(222,356,364,356,365,442,222,443);
fill(random(100,96),random(100,63),random(100,178));
quad(222,449,364,449,364,525,223,527);
fill(220,223,232);
quad(371,0,506,0,506,79,371,78);
fill(random(100,89),random(100,75),random(100,186));
quad(371,84,506,85,506,128,371,128);
fill(220,223,232);
quad(371,134,506,133,506,251,371,251);
fill(random(100,254),random(100,231),random(100,3));
quad(371,447,506,448,506,525,371,525);
fill(random(100,204),random(100,199),random(100,203));
quad(371,531,506,531,506,559,371,560);
fill(random(100,252),random(100,231),random(100,4));
quad(512,0,600,0,600,126,512,128);
fill(random(100,238),random(100,68),random(100,42));
quad(512,134,547,133,547,441,512,443);
fill(255);
quad(553,133,600,133,653,441,553,441);
fill(255);
quad(512,448,600,447,600,560,512,560);
}

意涵就是人生如果是一幅拼圖 每個人所經歷的事情都有所不同
而每件事情在人生裡代表的顏色都不一樣
這是一幅屬於自己的人生拼圖

(發現我真夠會掰....)

小畫家&processing呈現

processing

畫的

程式碼:
size(800,600);
background(128,128,192);
fill(255,0,255);
triangle(0,1,0,284,625,0);
fill(255,0,128);
triangle(0,437,0,600,122,600);
fill(255,0,128);
triangle(800,444,612,600,800,600);
fill(192,192,192);
rect(80,64,110,110);
fill(255,128,64);
rect(127,80,435,180);
fill(128,128,128);
rect(126,79,64,95);
fill(128,128,255);
rect(292,15,53,65);
fill(128,128,255);
rect(433,20,55,60);
fill(255,255,0);
rect(292,80,53,65);
fill(255,255,0);
rect(433,80,55,60);
fill(0,64,128);
rect(165,260,108,282);
fill(0,64,128);
rect(400,260,108,282);
fill(0,255,255);
rect(106,202,20,250);
fill(0,255,0);
ellipse(560,180,270,62);
fill(0,0,0);
ellipse(500,180,80,32);
fill(128,128,255);
rect(325,210,47,50);
fill(0,128,0);
rect(325,260,47,100);
fill(255,0,0);
rect(515,228,47,25);


主題 : 透



圖片上的每一點,代表一個人的心的顏色,而黑色的背景,
就代表著撲朔迷離的社會。每個人一生下來內心是純潔的是白色的,
而人一生過半的時間都在社會這個大染缸打滾,
漸漸的內心的顏色也會被社會影響而有所改變。

圖中有正旋及逆旋,
正旋代表著人的性向及行為是往正向的,
逆旋代表著內心及所做所為比較違反一般社會規範,
而旋與旋所交會的部分,即代表了平常我們人與人之間的接觸與互動。

這一切的一切組成起來,就形成了我們一般的大眾社會。

code參考 :Processing_handbook.pdf_152頁
code: http://www.csie.mcu.edu.tw/~s5361116/pro/code.txt

自創作品-名稱:自以為的藝術





藝術從你做起

以亮麗糖果顏色加上點點來創造出別以往的藝術



這是程式碼


void setup() {
size(600, 800);
float a,b,c;
a =random(0,255);
b =random(0,255);
c =random(0,255);
background(b,a,c,150);
smooth();
}
void draw() {
float s = dist(mouseX, mouseY, pmouseX, pmouseY) + 1;
noStroke();
float a,b,c;
a =random(0,255);
b =random(0,255);
c =random(0,255);
fill(a,b,c,150);

ellipse(mouseX, mouseY, s, s);
stroke(255);
point(mouseX, mouseY);
}

延伸

從上次的圓形延伸動態變色
效果是每個圓都會隨著時間改變顏色
看起來就像有很多眼睛一直不斷在變色
很有迷幻的感覺

...

其實我是想寫時鐘的,但是processing 不支援單次定義法
也就是..
if(db==null){
db=1;
int x;
}
很可惜,如果processing可以這樣寫的話可以延伸更多動態圖案的...

void setup(){
size(800,600);
frameRate(10);
background(random(5,20),random(5,20),random(5,20),50);
}
void draw(){
for(int i=0;i<=800;i+=200){
for(int j=0;j<=600;j+=200){
fillstar(i,j);
}
}
}

void fillstar(int q,int k){
noStroke();
smooth();
float radius = 1;
for (int deg = 0; deg < 360*40; deg += 55) {
float angle = radians(deg);
float x=q+(cos(angle)*radius);
float y=k+(sin(angle)*radius);
fill(random(10,255),k--,q,q--);
ellipse(x, y, 5, 3);
radius = radius + 0.5;
}
}

2008年4月13日 星期日

蝴蝶



上次上課練習是圓形方陣
我們把圓形改成水滴狀
一樣用for迴圈+random去寫
然後有一行指令noLoop();
去第這行指令,這隻蝴蝶變的好像會動一樣!!
覺得很漂亮XD
顏色有控制的,所以才會呈現偏紅的樣子!!!
背景是彩虹的顏色,就像蝴蝶在大自然裡頭依樣!!!
哈哈哈!!!!!

程式碼
void setup(){
size(800,600);
background(255,255,255);
smooth();
noLoop();
colorMode(HSB);
for (int i = 0; i < 800; i++) { stroke(i*0.31, 255, 255); line(i, 0, i, 800); } } void draw(){ for(int j=10;j<=100;j+=30) { for(int i=0;i<=800;i+=150) { for(int k=0;k<=600;k+=120) { stroke(0,0,0); strokeWeight(4); fill(random(150,255),random(150,255),random(150,255),random(100,200)); bezier(80+i,80+k,j+200,j+400,j+400,j+600,80+i,80+k); } } } }

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

http://ss24.mcu.edu.tw/~s5360936/95360936/
(改版過的!!!!)

先丟


本來想營造:恐怖的眼睛"的氣氛的


不過色彩配的不好...


目前就這個比較滿意...


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

2008年4月10日 星期四

好多圓


void setup(){size(800,600); smooth(); noLoop(); }void draw(){for(int i=0;i<600;i+=200){for(int j=0;j<800;j+=200){circles_2(j, i);fill(random(255),random(255),random(255),255);int s=200;for(int z=1;z<18;z++) {s-=20;circles_1(j+100,i+100,s);fill(random(255),random(255),random(255),125);}}}}void circles_1(int a, int b,int c){ ellipse(a,b,c,c);}void circles_2(int a,int b){rect(a, b, 300, 300);}

2008年4月8日 星期二

HW07-2:圓之陣列

原始圖: 我的圖: http://i193.photobucket.com/albums/z170/.png 程式碼: http://i193.photobucket.com/albums/z170/.png

HW07-1:亂數與迴圈

原始圖: 我的圖: http://i193.photobucket.com/albums/z170/.png 程式碼: http://i193.photobucket.com/albums/z170/.png

課堂練習2



void setup() {size(800,600);background(255,255,255);noLoop();}void draw(){ float a,b,c;for(int i=0;i<800;i+=200){ j="0;j<600;j+="200)" a="random(0,255);" b="random(0,255);" c="random(0,255);" x="0;x<8;x++)" a="random(0,255);" b="random(0,255);" c="random(0,255);" p="random(0,200);">

名畫







size(800,600 );
background(0,0,0);
float r,g,b,t;

for(int i=0;i<800;i+=200)
{

for(int j=0;j<600;j+=200)
{
r=random(0,255);
g=random(0,255);
b=random(0,255);
t=random(0,255);
fill(r,g,b,t);
rect(i,j,200,200);
for(int k=200;k>0;k-=5)
{
r=random(0,255);
g=random(0,255);
b=random(0,255);
t=random(0,255);
fill(r,g,b,t);
ellipse(i+100,j+100,k,k);
}

}
}

圓形方陣

程式碼:


size(800,600 ); background(0,0,0); float r,g,b,s;
for(int i=0;i<800;i+=200){ j="0;j<600;j+=" k="200;k">0;k-=8) { r=random(0,255); g=random(0,255); b=random(0,255); s=random(0,255); fill(r,g,b,s); ellipse(i+100,j+100,k,k); } r=random(0,255); g=random(0,255); b=random(0,255); s=random(0,255); fill(r,g,b,s); rect(i,j,200,200); }}

世界名畫


框框中的圓

void setup()
{
size(800,600);
noLoop();
}
void draw()
{
float a;
for(int i=0;i<800;i+=200)
{
for(int j=0;j<600;j+=200)
{
fill(random(0,100),random(0,100),random(0,100),random(0,255));
rect(i,j,200,200);
for(int q=0;q<20;q++)
{
a=random(30,150);
noStroke();
fill(random(150,255),random(150,255),random(150,255),random(20,60));
ellipse(i+100,j+100,a,a);
}
}
}
}

方陣方陣方陣啦!!!!!!!!!!!!!!!!!!!!!!!



void setup(){
size(800,600);
background(255,255,255);
noLoop();
}
void draw()
{
for(int j=0;j<=50;j+=7){ for(int i=0;i<=800;i+=100){ for(int k=0;k<=600;k+=100){ fill(random(0,200),random(0,200),random(0,200),random(0,100)); rect(50-j+i,50-j+k,0+j*2,0+j*2); fill(random(0,200),random(0,200),random(0,200),random(0,100)); ellipse(50+i,50+k,j+30,j+30); }}}}
一開始誤會老師所說的,我們還很隨性的讓圓形方形到處亂跑,連大小都給他隨便亂跑然後這是修改過後的樣子,也許是圖畫的比較小,所以展開,變的一點都不可愛!!!


↑這是我們後來又修改過的!!!
除了大小改變以外還加上另外兩個指令
smooth(); //平滑處理
strokeWeight(5);//線條寬度5
就變成這樣子哩!!!!

幾何畫










void setup()
{
size(800,600);
background(0);
smooth();
noLoop();//stop loop
}

void draw()
{
float lx,ca,cb,cc;

for(int j=0;j<600;j+=200)
{
for(int i=0;i<800;i+=200)
{
ca=random(0,255);
cb=random(0,255);
cc=random(0,255);
strokeWeight(4);
fill(ca,cb,cc,150); //顏色
rect(i,j,200,200); //正方形
lx=200;
for(int s=0;s<6;s++) //圓形繪畫
{
ca=random(0,255);
cb=random(0,255);
cc=random(0,255);
fill(ca,cb,cc,150);
lx-=30;
ellipse(i+100,j+100,lx,lx); //圓形
}
}
}
}

方陣中的圓形


void setup()
{
size(800,600); //設定影像大小
smooth(); //平滑處理
noLoop(); //不重複執行draw()
}

void draw()
{
for(int i=0;i<600;i+=200)
{
for(int j=0;j<800;j+=200)
{
circles_2(j, i);
fill(random(255),random(255),random(255),100);
int s=200;
for(int z=1;z<4;z++)
{
s-=50;
circles_1(j+100,i+100,s);
fill(random(255),random(255),random(255),100);
}
}
}
}

void circles_1(int x, int y,int s)
{
ellipse(x, y, s,s);
}

void circles_2(int x,int y)
{
rect(x, y, 200, 200);
}

嗯嗯...


圓圓方方

void setup(){size(800,600);background(0,255,255,25);noLoop();}
void draw(){ float co1,co2,co3,co4;for(int i=0;i<16;i++){for(int j=0;j<4;j++){
rect(j*200,i*200,200,200);fill(random(0,255),random(0,255),random(0,255));ellipse(j*200+100,i*200+100,200,200);fill(random(0,255),random(0,255),random(0,255));
ellipse(j*200+100,i*200+100,190,190);fill(random(0,255),random(0,255),random(0,255));ellipse(j*200+100,i*200+100,185,185);fill(random(0,255),random(0,255),random(0,255));
ellipse(j*200+100,i*200+100,150,150);fill(random(0,255),random(0,255),random(0,255));ellipse(j*200+100,i*200+100,145,145);fill(random(0,255),random(0,255),random(0,255));ellipse(j*200+100,i*200+100,120,120);fill(random(0,255),random(0,255),random(0,255));ellipse(j*200+100,i*200+100,100,100);fill(random(0,255),random(0,255),random(0,255));
}}}


2008年4月7日 星期一



程式碼
void setup()
{
size(800,600);
background(0);
noLoop();
}

void draw()
{

float x;
for(int i = 100 ; i<=700 ; i=i+200)
{
for(int j = 100 ; j<=500 ; j=j+200)
{
fill(random(100,250),random(100,250),random(100,250),random(30,50));
rect(i-100,j-100,200,200);
fill(random(100,250),random(100,250),random(100,250),random(30,50));
ellipse( i , j , 200 , 200 ) ;
for(int a=0 ; a<30 ; a++)
{
x = random(20,180);
noStroke();
fill(random(100,250),random(100,250),random(100,250),random(30,50));
ellipse( i , j , x , x ) ;
}
}
}
}

幾何圖



顏色比較柔和一點

看起來不會很怪

世界名畫(偽)


不知為何顏色有點詭異
懶的調了
程式碼:
void setup()
{
size(800,600);
background(0);
noLoop();
}
void draw(){
float x;
for(int i = 100 ; i<=800 ; i=i+200){
for(int j = 100 ; j<=600 ; j=j+200){
fill(random(250),random(250),random(250),random(250));
rect(i-100,j-100,200,200);
fill(random(250),random(250),random(250),random(250));
ellipse(i,j,200,200) ;
for(int a=0 ; a<20 x =" random(20,180);">
noStroke();
fill(random(250),random(250),random(250),random(250));
ellipse( i , j , x , x ) ;
}
}
}
}

作業2




code:

void setup(){
size(800,600);
background(255);
noLoop();
}
void draw(){
for(int i=0;i<=800;i+=200){
for(int j=0;j<=600;j+=200){
fill(random(100,255),random(100,255),random(100,255));
rect(i,j,200,200);
elli(i+100,j+100);
}
}
}
void elli(int x,int y){
for(int i=200;i>=10;i-=20){
fill(random(100,255),random(100,255),random(100,255));
ellipse(x,y,i,i);
}
}

圓圈



程式碼
void setup()
{
size(800,600);
background(0);
noLoop();
}

void draw()
{

float x;
for(int i = 100 ; i<=700 ; i=i+200)
{
for(int j = 100 ; j<=500 ; j=j+200)
{
fill(random(100,250),random(100,250),random(100,250),random(30,50));
rect(i-100,j-100,200,200);
fill(random(100,250),random(100,250),random(100,250),random(30,50));
ellipse( i , j , 200 , 200 ) ;
for(int a=0 ; a<30 ; a++)
{
x = random(20,180);
noStroke();
fill(random(100,250),random(100,250),random(100,250),random(30,50));
ellipse( i , j , x , x ) ;
}
}
}
}

模仿畫



code:
void setup(){
stroke(200);size(800,600);background(255,255,255);
noLoop();}

void draw(){for(int i=0;i<4;i++){ for(int j=0;j<4;j++) { fill(random(150,255),random(150,255),random(150,255),random(150,255)); rect(i*200,j*200,400,400);
for(int k=200;k>0;k-=50) { fill(random(150,255),random(150,255),random(150,255),random(150,255));
ellipse(i*200+100,j*200+100,k,k); }}}}

yayayaya cute



size(800,600);
smooth();
for(int i=0;i<=800;i+=200){ for(int j=0;j<=600;j+=200) { float color1=random(255); float color2=random(255); float color3=random(255); float color4=random(255); fill(color1,color2,color3,color4); stroke(color1,color2,color3,color4); rect(i,j,200,200); for(int x=100;x<=700;x+=200){ for(int y=100;y<=500;y+=200) { float color5=random(255); float color6=random(255); float color7=random(255); stroke(color5,color6,color7,255); fill(color5,color6,color7,255); float big=random(200); ellipse(x, y, big, big); } }}}

for迴圈


void setup()
{
size(800,600);
background(60,60,60);
noLoop();
}
void draw()
{
for(int j=0;j<80;j++)
{
float x,y,c1,c2,c3,c4;
x = random(0,800);
y = random(0,600);
c1 = random(0,255);
c2= random(0,255);
c3 = random(0,255);
c4 = random(0,255);
fill(c1,c2,c3,c4);
ellipse(x,y,40,40);
}
for(int i=0;i<220;i++)>
{
float x,y,lx,ly,c1,c2,c3,c4; // Random rand = new Random();
x = random(0,800);
y = random(0,600);
lx = random(0,100);
ly = random(0,100);
c1 = random(0,255);
c2= random(0,255);
c3 = random(0,255);
c4 = random(0,255);
fill(c1,c2,c3,c4);

rect(x,y,lx,ly); }
}