美文网首页
06 教孩子学编程 processing 画贝塞尔曲线

06 教孩子学编程 processing 画贝塞尔曲线

作者: Mack老师 | 来源:发表于2020-05-05 14:35 被阅读0次

size(600,400);

background(255);

noFill();

for(int x=150;x<=450;x=x+10)

{

  bezier(300,100,x,100,x,300,300,300);

}

size(600,400);

background(255);

noFill();

for(int x=150;x<=450;x=x+5)

{

  strokeWeight(3);

  stroke(255,0,255,90);

  bezier(300,100,x,100,x,300,300,300);

}

size(600,400);

background(255);

noFill();

for(int x=200;x<=400;x=x+5)

{

  strokeWeight(3);

  stroke(255,0,255,90);

  bezier(300,100,x,170,x,300,300,300);

}

void setup(){

size(800,800);

background(0);

}

void draw(){

//background(0);

//随机颜色

stroke(random(255),random(0),random(255));

strokeWeight(random(10));

line(mouseX,mouseY,mouseX,0);

//此处是重点

}

相关文章

网友评论

      本文标题:06 教孩子学编程 processing 画贝塞尔曲线

      本文链接:https://www.haomeiwen.com/subject/xesmghtx.html