2020年10月26日 星期一

WEEK-7

 Processing

畫三角:


void setup(){
  size(500,500);
}
void draw(){
  //background(0);
  beginShape();
  for(int angle=0; angle<360; angle+=120){
    float angle2 = radians(angle+frameCount);
    float x = mouseX+cos(angle2)*30;
    float y = mouseY+sin(angle2)*30;
    vertex(x,y);
  }
  endShape(CLOSE);
}





沒有留言:

張貼留言