processing과 max/msp를 공부할 예정
-1주차 basic programming
=====================================================
출석-양정애,김기창,이정우,김남윤,전주영,최주영,진다빈,이석기,변수홍,김상은,류승환,공혜선
=====================================================
1.기본 프로그래밍에 관해 - p29~32
프로그램에서 사용하는 기호(명칭) - p29
=====================================================
2.메뉴에 관해 - p38~39
=====================================================
3. size (가로,세로);
화면x,y좌표 읽는
문법-첫번째 영어는 소문자 두번째는 때에 따라 대문자
=====================================================
4. point(x, y) line(x1, y1, x2, y2)
=====================================================
5. rect(좌상각의 x, 좌상각의 y, 가로, 세로);
triangle(x1, y1, x2, y2, x3, y3);
quad(x1, y1, x2, y2, x3, y3, x4, y4);
rectMode(CORNER)(CENTER)(CORNERS)
=====================================================
6.ellipce(중심의 x,중심의 y,가로, 세로)
arc(좌상각의 x, 좌상각이 y, 그리기 시작하는 각도,그리기 끝내는 것의 각도)
각도(0~360)

=====================================================
7.curve(x1, y1, x2, y2,x3, y3, x4, y4), bezier…

=====================================================
8.색 RGB,HSB
colorMode(RGB,100)
background
=====================================================
9.stroke,nostroke,strokeWeight
10.fill,noFill
11.smooth,
=====================================================
12.데이터입력법
int=-1,0,1..
float=소숫점 가능
boolean=yes,no,true,false인지 상태 기억
color
width,height
예제로 p63꺼
=====================================================
13.for문

size(200, 200);
colorMode(HSB, 100);
background(100);
for(int i =0 ; i < 100 ; i++) {
line(i, 50, i, width-50);
}

for(int i=0; i <200; i+=2)
——————————————————————————————————
size(200, 200);
colorMode(HSB, 100);
background(100);
noStroke();

for(int y=0; y < 10; y++){
for(int x=0; x < 10; x++){
fill(x*10, 10+y*10, 100);
rect(x*20, y*20, 10, 10);
}
}
=====================================================
14.random문
size(200, 200);
colorMode(HSB, 100);
background(100);
for(int x=0; x float color1 =random(100);
stroke(color1, 60, 100);
line(x, 0, x, height);
}
=====================================================
15.==,!=,&&,||
while은 for문과 비슷

if/else문

size(200, 200);
colorMode(HSB, 100);
background(100);
noFill();

int h;
int s;

for(int i=0; i < 1000; i++) {
float x =random(width);
float y =random(height);

if(x < width/2) {
h =30;
} else {
h=60;
}
if(y > width/2) {
h +=20;
} else {
h-=20;
}
if(x>50 && x < 150 && y >50 && y < 150) {
s = 100;
} else {
s = 40;
}
stroke(h,s,100);
ellipse(x,y,5,5);
}
=====================================================
16.switch-case-default(case에 안들어간 경우)
boolean에 관해

size(200, 200);
colorMode(HSB, 50);
background(50);

int grad_count =0;
boolean grad_change =false;

for(int x=0; x< width; x++){
if (grad_change) {
grad_count--;
} else {
grad_count++;
}
stroke(30, grad_count, 50);
line(x,0,x,height);
if(grad_count % 50 == 0){
grad_change =!grad_change;}
}
=====================================================
17.PImage

PImage image;
image =loadImage(image.jpg);
image(image,0,0);

tint(45,50,50,50)-칼라모드에 따라

=====================================================
18.PFont font =loadFont(asdad.vlw);
textfont(testfont);
text(“”,12,12);

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


다음 시간은 20일 토요일 6시
Posted by 알 수 없는 사용자