Processing画小黄人

新的作业是画一个小黄人~

运行结果

代码

void setup(){
  size(420,640);
}
void draw(){
  cloth();
  hands();
  body();
  cloth_();
  eyes_glasses();
  legs();
  mouth();
}
void hands(){
  stroke(0);
  strokeWeight(10);
  fill(249,217,70);//黄色
  triangle(80,335,30,380,80,420);
  triangle(330,335,380,380,330,420);
}
void body(){
  fill(249,217,70);//黄色
  stroke(0);
  strokeWeight(5);
  ellipse(205,200,250,250);
  rect(80,200,250,220); 
}
void eyes_glasses(){
  stroke(0);
  strokeWeight(5);
  fill(0);
  rect(85,200,240,20); 
  fill(255);
  ellipse(160,200,90,90);
  ellipse(250,200,90,90);
  strokeWeight(30);
  point(160,200);
  point(250,200);
}
void mouth(){
  stroke(0);
  strokeWeight(10);
  line(180,300,230,300);
}
void cloth_(){ 
  noStroke();
  fill(32,116,160);//蓝色
  rect(120,350,170,95);
  noFill();
  stroke(0);
  strokeWeight(10);
  rect(175,380,60,75);
  strokeWeight(5);
  line(120,350,290,350);
  line(120,350,120,420);
  line(290,350,290,420);
  stroke(32,116,160);//蓝色
  strokeWeight(25);
  line(80,340,115,350);
  line(330,340,290,350);
  stroke(0);
  point(115,350);
  point(290,350);
}
void cloth(){
  fill(32,116,160);//蓝色
  stroke(0);
  strokeWeight(5);
  ellipse(205,420,250,250);
}

void legs(){
  stroke(0);
  strokeWeight(40);
  line(185,540,185,590);
  line(226,540,226,590);
  line(150,590,190,590);
  line(226,590,266,590);
}
发布了3 篇原创文章 · 获赞 0 · 访问量 98
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 深蓝海洋 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览