作业2-创意自画像
作品*: 一件编程创意作品,必须实现动态效果或交互效果;作品录制一段一分钟内的视频;作品可以是具象化地描绘自己的形象,也可以是任何形式表现自己的兴趣、追求、特色、经历等;
报告:写一篇文章,发表为博文/推文等形式,描述运用的规律,若用到了数学/物理/化学等学科中的知识,要用平实易懂的语言介绍原理,尝试运用凝练的数学语言表达(公式、方程、推导等),特别要描述出这些原理如何在作品中呈现的。
提交内容与方式:
1.程序+视频+报告(博文转为doc或pdf),放入一个文件夹,按“学号+姓名”命名文件夹,由学习委员汇总后提交;
2.博文链接加入表格文档《作业登记》-创意编程作业-作业2-创意自画像
提交时间:2019.11.4
一、实验目的:
用编程方式创作一幅介绍自己的作品
二、实验要求:
编程语言与工具:编程可以用p5,processing。
三、实验步骤:
①先画背景图:
function setup(){
// put setup code here
createCanvas(640, 480);
angleMode(DEGREES); }
function draw() {
background(221, 160, 221);
strokeWeight(0);
}
②画呆毛和头发
//画呆毛
fill(208, 32, 144);
beginShape();
vertex(280, 100);
vertex(240, 120);
vertex(270, 130);
endShape(CLOSE);
//头发
fill(90, 10, 90);
ellipse(300, 150, 110, 110);
fill(255, 245, 238);
ellipse(300, 150, 80, 85);
fill(90, 10, 90);
beginShape();
vertex(270, 110);
vertex(290, 140);
vertex(315, 135);
vertex(310, 100);
endShape(CLOSE);
beginShape();
vertex(300, 120);
vertex(340, 140);
vertex(330, 110);
vertex(300, 100);
endShape(CLOSE);
beginShape();
vertex(280, 110);
vertex(280, 140);
vertex(260, 120);
endShape(CLOSE);
beginShape();
vertex(260, 115);
vertex(240, 190);
vertex(260, 210);
vertex(270, 120);
endShape(CLOSE);
beginShape();
vertex(246, 140);
vertex(235, 190);
vertex(260, 160);
endShape(CLOSE);
beginShape();
vertex(354, 140);
vertex(360, 190);
vertex(350, 175);
vertex(348, 185);
vertex(330, 160);
endShape(CLOSE);
beginShape();
vertex(260, 190);
vertex(270, 210);
vertex(275, 180);
endShape(CLOSE);
}
③衣服
//衣服
fill(54, 54, 54);
triangle(330, 120, 270, 250, 365, 255);
}
④腿
//腿
fill(255, 245, 238);
beginShape(