'Research Topics/Processing Studynote'에 해당되는 글 25건
- 2007.10.27 2차수업 과제 유승환
- 2007.10.27 3주차 강의
- 2007.10.20 시그2주차
- 2007.10.13 1주차
- 2007.10.07 sig
Research Topics/Processing Studynote2007. 10. 27. 15:48
Research Topics/Processing Studynote2007. 10. 27. 12:44
--출석: 김정운, 김남윤, 전주영, 유승환,변수홍, 최주영, 김동후, 박상현, 양정애, 김아진, 진다 빈
--주제:저희조는 물리적인 현상을 구현해보자는 제안이 나와 공을 topview에서 본듯한 효과 를 만들어 보았습니다.
PImage ball;
int x,y;
float ballSize;
int stayOnHand;
float a,v,s; // a는 가속도 v는 속도 s 는 높이.
// float t;
void setup(){
size(300,300);
x=y=150;
ballSize =50;
a= -9.8;
v= 0;
s = 1000;
stayOnHand = 1;
ball = loadImage("ball.jpg");
}
void draw(){
background(255);
if (mousePressed == true ){
if (stayOnHand != 0) stayOnHand = 0;
else if (stayOnHand == 0) {v=-100;}
dribble();
}
if (stayOnHand == 1){
x= mouseX;
y= mouseY;
}else if (stayOnHand == 0){
if (s<=0 ){v=-v-5;s=0;} // 공이땅에 닿은 경우 속도가 reverse, 이때 -5는 마찰에 의한 자연 감속
// t = t+0.001;
{
v = v+ a;
s = s + v;
}
}
ballSize = s/10+10;
image(ball, x-(ballSize/2),y-(ballSize/2), ballSize, ballSize);
}
void dribble(){
if (mouseX < x && mouseX > x-ballSize/2){x=x+2;}
if (mouseX > x && mouseX < x+ballSize/2){x=x-2;}
if (mouseY < y && mouseY > y-ballSize/2){y=y+2;}
if (mouseY > x && mouseY < y+ballSize/2){y=y-2;}
}
-----------------------------------------------------------------------------------
수업중에 한것
PImage ball;
boolean isItOnHand;
int x,y;
float a,v,s;
float ballSize;
void setup(){
size(600,600);
x=y= 300;
isItOnHand = true;
a = -9.8;
v = 0;
s = 1000;
ballSize = 110;
ball = loadImage("ball.jpg");
}
void draw(){
background(255);
if (mousePressed == true){
if (isItOnHand == true) isItOnHand = false;
else{
if (mouseX >x-ballSize/2 && mouseX < x+ballSize/2)
if (mouseY >y-ballSize/2 && mouseY < y+ballSize/2)
dribble();
}
}
if (isItOnHand == true){
x = mouseX;// 마우스 따라 움직임
y = mouseY;
}else{
if (s <= 0){v = -v-5;s= 0;}
v = v + a;
s = s + v;
ballSize = s/10+10;
// 공의 높이 계산
}
image(ball,x-(ballSize/2),y-(ballSize/2),ballSize,ballSize);
}
void dribble(){
v = -100;
if (mouseX < x && mouseX > x-ballSize/2) x = x+2;
if (mouseX > x && mouseX < x+ballSize/2) x = x-2;
if (mouseY < y && mouseY > y-ballSize/2) y = y+2;
if (mouseY > y && mouseY < y+ballSize/2) y = y-2;
}
--주제:저희조는 물리적인 현상을 구현해보자는 제안이 나와 공을 topview에서 본듯한 효과 를 만들어 보았습니다.
PImage ball;
int x,y;
float ballSize;
int stayOnHand;
float a,v,s; // a는 가속도 v는 속도 s 는 높이.
// float t;
void setup(){
size(300,300);
x=y=150;
ballSize =50;
a= -9.8;
v= 0;
s = 1000;
stayOnHand = 1;
ball = loadImage("ball.jpg");
}
void draw(){
background(255);
if (mousePressed == true ){
if (stayOnHand != 0) stayOnHand = 0;
else if (stayOnHand == 0) {v=-100;}
dribble();
}
if (stayOnHand == 1){
x= mouseX;
y= mouseY;
}else if (stayOnHand == 0){
if (s<=0 ){v=-v-5;s=0;} // 공이땅에 닿은 경우 속도가 reverse, 이때 -5는 마찰에 의한 자연 감속
// t = t+0.001;
{
v = v+ a;
s = s + v;
}
}
ballSize = s/10+10;
image(ball, x-(ballSize/2),y-(ballSize/2), ballSize, ballSize);
}
void dribble(){
if (mouseX < x && mouseX > x-ballSize/2){x=x+2;}
if (mouseX > x && mouseX < x+ballSize/2){x=x-2;}
if (mouseY < y && mouseY > y-ballSize/2){y=y+2;}
if (mouseY > x && mouseY < y+ballSize/2){y=y-2;}
}
-----------------------------------------------------------------------------------
수업중에 한것
PImage ball;
boolean isItOnHand;
int x,y;
float a,v,s;
float ballSize;
void setup(){
size(600,600);
x=y= 300;
isItOnHand = true;
a = -9.8;
v = 0;
s = 1000;
ballSize = 110;
ball = loadImage("ball.jpg");
}
void draw(){
background(255);
if (mousePressed == true){
if (isItOnHand == true) isItOnHand = false;
else{
if (mouseX >x-ballSize/2 && mouseX < x+ballSize/2)
if (mouseY >y-ballSize/2 && mouseY < y+ballSize/2)
dribble();
}
}
if (isItOnHand == true){
x = mouseX;// 마우스 따라 움직임
y = mouseY;
}else{
if (s <= 0){v = -v-5;s= 0;}
v = v + a;
s = s + v;
ballSize = s/10+10;
// 공의 높이 계산
}
image(ball,x-(ballSize/2),y-(ballSize/2),ballSize,ballSize);
}
void dribble(){
v = -100;
if (mouseX < x && mouseX > x-ballSize/2) x = x+2;
if (mouseX > x && mouseX < x+ballSize/2) x = x-2;
if (mouseY < y && mouseY > y-ballSize/2) y = y+2;
if (mouseY > y && mouseY < y+ballSize/2) y = y-2;
}
Research Topics/Processing Studynote2007. 10. 20. 20:31
Research Topics/Processing Studynote2007. 10. 13. 16:43
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시
-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
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시
Research Topics/Processing Studynote2007. 10. 7. 19:57