求教大神!!!!!急!!!!!
processing吧
全部回复
仅看楼主
level 1
yuhuquan1818 楼主
写的代码 想导出pdf格式 可是最后显示 Error on ""finished"" 谁能帮我看看哪里出错了呀
import processing.pdf.*;
void setup() {
size(400, 400, PDF, "filename.pdf");
}
void draw() {
smooth();
noLoop();
}
void draw() {
translate(350, 350);
for (int an=1; an<1600;an++) {
rotate(2*PI/an);
fl();
}
}
void fl() {
noFill();
beginShape();
vertex(0, 0);
int c1 = int(random(20, 10));
int c2 = int(random(-50, 800));
int c3 = int(random(800, -50));
int c4 = int(random(10,100));
stroke(0, 0, 0, 100);
bezierVertex(c2, c2, c1, c2, c1, c2);
bezierVertex(c1, c2, c1, c2, c1, c2);
bezierVertex(c4, c4, c3, c4, c3, c3);
bezierVertex(c4, c4, c3, c4, c3, c4);
endShape();
fill(50, 40, 63, 00);
noStroke();
ellipse(c1, c2, 5, 5);
}
// Exit the program
println("Finished.");
exit();
}
2015年09月24日 16点09分 1
level 6
我查了一下,你程序报错 ‘It looks like you’re mixing “active” and “static” modes.’
http://w3fstack.com/question/processing-it-looks-like-youre-mixing-active-and-static-modes/ 这里有解释,大约一种是程序循环模式,一种是命令行类似的模式,但是你现在混合在一起了。
下面是一个可以用的demo 我这边是正常的
import processing.pdf.*;
size(600,600,PDF,"line.pdf");
background(255);
stroke(0);
line(200,0,width/2,height);
exit();
你可以根据这个程序修改一下你的代码
2015年09月25日 13点09分 2
谢谢!!
2015年10月01日 20点10分
1