We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › SimplePostcript rotate(deg)
Page Index Toggle Pages: 1
SimplePostcript rotate(deg) (Read 1265 times)
SimplePostcript rotate(deg)
Jun 23rd, 2006, 4:18pm
 
Hi there,

I'm using SimplePostcript libraries to make some visual stuff for a printed magazine.
Everything works perfect except that I can't resolve how to rotate a simple object.

In the code as follows, the rectangles in the sketch are in different position and rotation than the rectangles in the .ps

Please help!!!!

See the code:

void paint() {

   x = random(mw/3)+((mw/3));
   y = random(mh/3)+((mh/3));

   float rectH = random(180)+60;
   float rectW = random(2)+2;
   float rdmDeg = random(360);
   int rdmGray = int(random(50));
   float radianes = radians(rdmDeg);
   
   pushMatrix();
   translate(x,y);
   rotate(radianes);
   noStroke();
   fill(rdmGray);
   rect(0,0, rectW, rectH);
   popMatrix();
   
   if (ps.isOpen) {
           ps.gsave();
           ps.translate(x,y);
           ps.rotate(rdmDeg);
           ps.setrgb(rdmGray,rdmGray,rdmGray);
           ps.rect(0, 0, rectW, rectH);
           ps.fill();
           ps.grestore();
   }

   smooth();
   
 }

Thanks in advance,
Natalia
Re: SimplePostcript rotate(deg)
Reply #1 - Jun 23rd, 2006, 8:05pm
 
By the moment, I've solved it using the .pdf libraries
Page Index Toggle Pages: 1