求助,关于显示坐标系的代码
processing吧
全部回复
仅看楼主
level 9
SpriteCool 楼主
下面这段代码在processing 1.5.1下显示正常,但是2.2却只能显示为若干白块,求大神修改能在2.2下正常运行。
final int VIEW_SIZE_X = 600, VIEW_SIZE_Y = 600;
void setup()
{
size(VIEW_SIZE_X, VIEW_SIZE_Y, P3D);
}
void draw() {
background(#000000);
fill(#ffffff);
// display axes显示轴
translate(450, 250, 0);
stroke(#ffffff);
scale(100, 100, 100);
line(0, 0, 0, 1, 0, 0);
line(0, 0, 0, 0, -1, 0);
line(0, 0, 0, 0, 0, 1);
}
2014年05月24日 13点05分 1
level 3
//scale(100, 100, 100);
line(0, 0, 0, 100, 0, 0);
line(0, 0, 0, 0, -100, 0);
line(0, 0, 0, 0, 0, 100);
去掉scale(100, 100, 100);这行 将下面的1直接写为100.
2014年05月24日 13点05分 2
用你的方法成功了,谢谢你[真棒]再问一下,这个scale代表比例的话,为何下面line的数据0也会被缩放呢,是不是processing 1.5以后的版本对这个数据0的意义有了新的定义呢?
2014年05月24日 14点05分
回复 SpriteCool :0没有被缩放~是你用scale扩大100倍直接把线的粗细也同时扩大了100倍~所以看起来是两个方形。这可能是个bug~不用理~
2014年05月24日 14点05分
1