본문 바로가기
728x90
반응형

processing8

[프로세싱 시험대비] 시험에 나올만 한것들 정리 불꽃놀이 🌈 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 void setup(){ size(600,600); } void draw(){ background(0); int n=0; strokeWeight(3); while(n 2022. 6. 12.
[프로세싱 시험대비] Lecture08_transform transform에서 중요한것을 뽑자면 1. sin과 cos이용 2. pushMatrix / popMatrix 3. translate이다. 예제 1 1. sin,cos으로 풀어보기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 void my_circles1(){ float radius=300; float centerX=width/2; float centerY=height/2; for(float angle=0;angle360 degree PI==3.14 pushMatrix(); float x=centerX+radius*cos(angle); float y=centerY+radius*sin(angle); fill(angle/TWO_PI*255); ellipse(x,y,50,5.. 2022. 6. 4.
[Processing] Chapter 7_function/ Chapter8_Object Loop Mouse 마우스를 움직일때 마우스의 가장 중간지점은 검은색이고 옆으로 갈수록 흐릿해지는 효과를 줄 것이다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 void setup(){ size(480,270); } void draw(){ int i=0; while(iwidth){ speed*=-1; }else if(x-diam/2 width , x-diam/2width){ xPos=0; } } } cs color라는 데이터 타입이 있는게 신기했다. Two Object single Object 부분에 이어서 자동차 객체를 2개 만들어볼 것이다. 객체를 2개 만들고 싶으면 생성자에 매개변수를 두면 좋다. 1 2 3 4 5 6 .. 2022. 3. 13.
[Processing] Chapter5_조건문 constrain() value가 가질 수 있는 값을 제한해주는 함수이다. constrain(변수,min,max) 순으로 쓴다. 예를 들어 r,g,b 값을 제한해주고 싶으면 r=constrain(r,0,255); --> 이런식으로 쓰면 된다. Rollovers 칸이 네칸으로 나눠져 있고 네 칸 중 한 칸에 마우스를 가져갔을 때 검은색으로 사각형이 변하게 만들어볼 것이다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 float r,g,b=0; void setup(){ size(480,270); } void draw(){ background(255); line(width/2,0,width/2,hei.. 2022. 3. 12.
728x90
반응형