2017년 4월 4일 화요일


학생작품 예제 - mouse position, mousePressed




















//The fireworks burst in the black sky

void setup() {
  size( 800,800);
  background(0);
  smooth();
} //size,color setup


void draw() {
  smooth();
  stroke(255,165,0);
  line(mouseX,mouseY,220,220);
  stroke(220,020,060);
  line(mouseX,mouseY,450,450);
  stroke(255,160,122);
  line(mouseX,mouseY,220,650);
  stroke(255,182,193);
  line(mouseX,mouseY,700,100);

}//There are three of the color of lines and locate.


void mousePressed() {
  stroke(255);
 fill(240,230,140);
 ellipse(mouseX,mouseY,50,50);
 fill(#F7F25A);
 ellipse(mouseX,mouseY,30,30);

}
//Two by superimposing the color and locate a circle.

댓글 없음:

댓글 쓰기

아두이노와 프로세싱 연동: 가변저항으로 프로세싱 색상제어

아두이노와 프로세싱을 연동하는 프로젝트로서, 아두이노의 가변저항을 조절하여 프로세싱의 rect의 색상을 조절해봅니다. 과정은 간단합니다.  1. 아두이노보드에 가변저항을 연결합니다. 가변저항의 세 단자에 GND, 5V, 그리고 A0(아날로...