2017年3月9日星期四

2017.03.09  프로세싱 수업:

렌덤한 칼러와 위치를 가진 점들을 그려봤습니다.

int centerX, centerY;
float x, y, angle, radius, rad;

void setup()
{
  frameRate(1.5);
  radius=100;
  centerX = width/2;
  centerY = height/2;
  size(1280,720);
  stroke(0);
}

void draw()
{
  background(255);
  for (angle = 0; angle < 360; angle++)
  {
 
    rad = radians(angle);
    x = centerX + 2*(radius * cos(rad) * cos(random(0,720)));
    y = centerY + 2*(radius * sin(rad) * sin(random(0,720)));

    stroke(random(0,255),random(0,255),random(0,255),255);
    strokeWeight(random(0,25));
    point(x,y);
  }
}

没有评论:

发表评论