看到题目,我还以为你是要画国旗,结果你特么告诉我你要画美国队长的logo
;
我来教你画国旗好了
int [] n={1,3,5,7,9,11};
float [] m;
float [] z;
void setup(){
colorMode(HSB,360,100,100);
//HSB红黄绿青蓝紫
//fullScreen();
size(500,500);
background(360,100,100);
//translate(250,250);
}
void draw(){
if(mousePressed==true){
translate(mouseX,mouseY);
scale(0.3333);}else{
translate(width/2,height/2);
}
m = new float[6];
z = new float[6];
fill(60,100,100);
strokeWeight(3);
noStroke();
beginShape();
for (int i=0;i<n.length;i++){
rotate(-PI/10);
m [i]=map(sin(0.4*n[i]*PI),-1.0,1.0,-100.0,100.0);
z [i]=map(cos(0.4*n[i]*PI),-1.0,1.0,-100.0,100.0);
vertex(m[i],z[i]);
} endShape(CLOSE);
}