Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Translate doesn't work with vertex

$
0
0

Hey guys,

I'm completely new to processing, seems a magnificent tool!

But I have a problem which in the end comes to this prototype example:

size (600,600);
translate(width/2, height/2);
background(255);
stroke(0);
noFill();

//does work
beginShape();
vertex(0,0);
vertex(20,0);
vertex(20,20);
vertex(0,20);
vertex(0,0);
endShape();

//doesn't work, no square drawn
beginShape();
vertex(0,0);
translate(50,0);
vertex(0,0);
translate(0,50);
vertex(0,0);
translate(-50,0);
vertex(0,0);
translate(0,-50);
vertex(0,0);
endShape();

It would be nice for my further application if the second square would be drawn correctly as well (I know, this example is stupid, but it's the easiest way to explain my problem I think).

Does translate not work together with vertex or beginshape/endshape?

Thanks a lot for your help!

Martin


Viewing all articles
Browse latest Browse all 2896

Trending Articles