float radius;
int segment = 6;
float centerX;
float centerY;
int recursionLevel = 3;
void setup(){
size(600,600);
background(0);
stroke(255);
centerX = height/2;
centerY = width/2;
}
void draw(){
background(0);
radius = dist(centerX, centerY, mouseX, mouseY);
spiral(centerX,centerY,radius,segment, recursionLevel);
}
void spiral(float x_c,float y_c, float r, int seg,int level){
level -= 1;
noFill();
ellipse(x_c,y_c,2*r,2*r);
for(int i =0;i<seg;i++){
float x = x_c+cos(i*2*PI/seg)*r;
float y = y_c+sin(i*2*PI/seg)*r;
point(x,y);
ellipse(x,y,2*r,2*r);
if(level>0){
spiral(x,y,r,seg, level);
}
}
}
2016年10月26日 星期三
2016年10月18日 星期二
week 7. using sin(x)
sample codes:
float radius;
int segment = 10;
float centerX;
float centerY;
void setup(){
size(600,600);
background(0);
stroke(255);
centerX = height/2;
centerY = width/2;
}
void draw(){
background(0);
radius = dist(centerX, centerY, mouseX, mouseY);
spiral(centerX,centerY,radius,segment);
}
void spiral(float x_c,float y_c, float r, int seg){
for(int i =0;i<=seg;i++){
float x = x_c+cos(i*2*PI/seg)*r; //算出x的位置
float y = y_c+sin(i*2*PI/seg)*r; //算出y的位置
point(x,y); // 畫出點,也能用其他形狀
}
}
EX:
1. 每次點擊滑鼠,劃一個隨機半徑大小的圓。
2. draw flower of life (生命之花)
reference:
John Whitney
https://www.youtube.com/watch?v=BzB31mD4NmA
期中作業:
動態對照的練習,共6組。
deadline Nov. 23, 2017
float radius;
int segment = 10;
float centerX;
float centerY;
void setup(){
size(600,600);
background(0);
stroke(255);
centerX = height/2;
centerY = width/2;
}
void draw(){
background(0);
radius = dist(centerX, centerY, mouseX, mouseY);
spiral(centerX,centerY,radius,segment);
}
void spiral(float x_c,float y_c, float r, int seg){
for(int i =0;i<=seg;i++){
float x = x_c+cos(i*2*PI/seg)*r; //算出x的位置
float y = y_c+sin(i*2*PI/seg)*r; //算出y的位置
point(x,y); // 畫出點,也能用其他形狀
}
}
EX:
1. 每次點擊滑鼠,劃一個隨機半徑大小的圓。
2. draw flower of life (生命之花)
reference:
John Whitney
https://www.youtube.com/watch?v=BzB31mD4NmA
期中作業:
動態對照的練習,共6組。
deadline Nov. 23, 2017
week 6. 3D primitives & mouse
sample codes:
size(640, 360, P3D); background(0); lights(); noStroke(); pushMatrix(); translate(130, height/2, 0); rotateY(1.25); rotateX(-0.4); box(100); popMatrix(); noFill(); stroke(255); pushMatrix(); translate(500, height*0.35, -200); sphere(280); popMatrix();
2016年10月11日 星期二
week 5. structure programming
Global variables v.s. local variables
subroutine calls
EX:
use subroutine call to perform 10 x 10 element-drawing.
subroutine calls
EX:
use subroutine call to perform 10 x 10 element-drawing.
2016年9月27日 星期二
week 4. statements and structure
1. ACG at MIT Media Lab.
Aesthetic and computation Concept video
2. for-loop
if
Ex: Draw 10x10 basic elements with some repetition
Aesthetic and computation Concept video
2. for-loop
if
Ex: Draw 10x10 basic elements with some repetition
2016年9月20日 星期二
week 2. [活動]字體設計論壇研討會
【9/21字體設計論壇研討會 : 廖韡X曾國榕X仇寅】
9/21(三) 13:30~16:30 台灣科大國際大樓1F國際會議廳字型範例:
PFont myFont;
void setup() {
size(200, 200);
// Uncomment the following two lines to see the available fonts
//String[] fontList = PFont.list();
//printArray(fontList);
myFont = createFont("Georgia", 32);
textFont(myFont);
textAlign(CENTER, CENTER);
text("HELLO", width/2, height/2);
}
2016年9月13日 星期二
week 1. introduction
Aesthetic Computing: A Brief Tutorial
An Introduction to Aesthetic Computing by Paul Fishwick
booklist
conceptual art
computational aesthetics ?
Wassily Kandinsky
Victor Vasarely
Sol Lewitt
code artists:
Ben Laposky, 1914-2000
John Whitney Sr., 1918-1995
Herbert W. Franke, 1927-
Lillian Schwartz, 1927-
Harold Cohen, 1928-
Roman Verostko, 1929-
George Legrady, 1950-
Mark Napier, 1961-
John F. Simon Jr., 1963-
John Maeda, 1966-
Mary Flanagan, 1969-
Casey Reas, 1970-
Jared Tarbell, 1973-
Ben Fry, 1975-
An Introduction to Aesthetic Computing by Paul Fishwick
booklist
conceptual art
computational aesthetics ?
Wassily Kandinsky
Victor Vasarely
Sol Lewitt
code artists:
Ben Laposky, 1914-2000
John Whitney Sr., 1918-1995
Herbert W. Franke, 1927-
Lillian Schwartz, 1927-
Harold Cohen, 1928-
Roman Verostko, 1929-
George Legrady, 1950-
Mark Napier, 1961-
John F. Simon Jr., 1963-
John Maeda, 1966-
Mary Flanagan, 1969-
Casey Reas, 1970-
Jared Tarbell, 1973-
Ben Fry, 1975-
訂閱:
文章 (Atom)