CreativeInquiry / PEmbroider

Embroidery Library for Processing
Other
443 stars 28 forks source link

transformation matrix does not work on E.line(x,y,x,y) #86

Closed stephanschulz closed 3 years ago

stephanschulz commented 3 years ago

I am trying to draw a bunch of lines just like the PEmbroider_lines_1 example shows. But the following does show the same results as not using push/pop.

 pushMatrix();
 translate(200, 50);
 rotate(45);
 E.line (0,0,100,100);
 popMatrix();
golanlevin commented 3 years ago

Try using E.pushMatrix(), E.translate(), etc.? or am I misunderstanding your question? See for example https://github.com/CreativeInquiry/PEmbroider/blob/master/API.md#void-translatefloat-x-float-y

stephanschulz commented 3 years ago

You are totally right. This works just fine. Sorry, should have know this by now.

  E.pushMatrix();
  E.scale(0.3, 0.3);
  E.translate(200, 0);

E.popMatrix();
golanlevin commented 3 years ago

No problem. In this regard PEmbroider operates much more like the PGraphics object in Processing, than an alternative rendering pipeline like the PDF renderer.