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 & HelpSyntax Questions › doesn't record anymore, when ellipseMode-CORNER
Page Index Toggle Pages: 1
doesn't record anymore, when ellipseMode-CORNER (Read 819 times)
doesn't record anymore, when ellipseMode-CORNER
Jun 23rd, 2009, 6:36am
 
very strange, works all well, but when i put ellipseMode to corner i have a white PDF file which will not open in acrobat???
here is the code:
Code:
import processing.pdf.*; 
float h,cx1,cy1,cx2,cy2;
float num;
float rand;
void setup()
{
 size(1000,1000);
 background(255);
 frameRate(12);
 smooth();
 beginRecord(PDF,"bugtestX.pdf");
}
void draw(){
 rand = (mouseX);
 for(int i=0; i<1; i++) {
   initRing();
 fill(255,random(150));
 stroke(0,random(100)+150);
 strokeWeight (1);
 drawRing(random(width),random(height),random(0.5,1));  
 }
}
void drawRing(float x,float y,float rad) {
 pushMatrix();
 translate(x,y);
 scale(rand/300);

 for(float i=0; i<11; i++) {
for(int k = 0; k < 40; k ++) {
 //ellipseMode(CORNER); ////////////////////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ellipse(cx1,cy1,cx2/k,cx2/k);
 rotate(radians(360/num));
}
   }
 popMatrix();
}
void initRing() {
 num=(int)random(9,29);
 h=random(150,200);
 cx1=random(0,200);
 cy1=random(0,h/2);
 cx2=random(0,100);
 cy2=random(h/2, h);
}
void mousePressed() {
  endRecord();
  exit();
 }



Re: doesn't record anymore, when ellipseMode-CORNER
Reply #1 - Jun 23rd, 2009, 8:52am
 
Just a wild guess as I have no time right now to test: perhaps the rotation just moves the objects outside of the displayed surface (eg. above or below it).
Re: doesn't record anymore, when ellipseMode-CORNER
Reply #2 - Jun 23rd, 2009, 12:14pm
 
thanks PhiLho! ...i guess not, because so the pdf file wouldn't be broken.
another strange thing, while i performe the recording, the image looks fine...?
Re: doesn't record anymore, when ellipseMode-CORNER
Reply #3 - Jun 23rd, 2009, 12:55pm
 
Yes, if display is OK, it should be OK on the PDF too.
I had time to test it now. First I ran the sketch as given... and got a zero byte PDF file! Ah, I closed the sketch, not clicked on it. Running it again, closing it properly, I got the right PDF file.
Now I uncomment the line (note that you can call this line in setup()).
I took care of closing the sketch by clicking it. I got a correct PDF again.
Nice effects BTW.
Tested on Windows XP.

You can ensure a graceful end with following code:
Code:
void mousePressed() {
exit();
}
void stop()
{
endRecord();
super.stop();
}
Re: doesn't record anymore, when ellipseMode-CORNER
Reply #4 - Jun 24th, 2009, 2:48am
 
thank you so much!
...unfortunately it doesn't work here. i tested it on two different xp computers. its white:(
when i put the ellipseMode (CORNER); line into setup, it works, but the ellepse don't have the corner mode..
i'll reinstall java next...
Re: doesn't record anymore, when ellipseMode-CORNER
Reply #5 - Jun 24th, 2009, 3:07am
 
so, i installed java and processing new. does not work yet.
even when i change ellipse to rect (without any ..mode indication) it does not work:(Sad...

the file have a normal size. when i render longer, that they're bigger. but white.
i more and more think it might have something to do with my adobe pdf recognition, since the opening error comes up in both, acrobat and photoshop...
Re: doesn't record anymore, when ellipseMode-CORNER
Reply #6 - Jun 24th, 2009, 4:30am
 
yeah!Smiley that was it! ...i installed a freeware pdf software, it opens the file and everything is fine!!!
thank you again, without your test, i would have never found that!
Re: doesn't record anymore, when ellipseMode-CORNER
Reply #7 - Jun 24th, 2009, 4:42am
 
Well, I tested the sketch on another computer and there, with the other mode, the opened file remains white. I use Foxit Reader on both computers to read the PDF file (gave up on bloated Acrobat Reader for quite some time now).
The file has normal size (around 500KB, I click quickly to keep it simple) but I found out that Foxit was eating virtual memory like crazy (slowing down the computer to a crawl). I had to kill it.
Not sure what is the problem (had the same issue with Processing 1.0.1 and 1.0.5, similar configurations/softwares)...
Re: doesn't record anymore, when ellipseMode-CORNER
Reply #8 - Jun 25th, 2009, 1:17am
 
yesterday i checked about 10 different pdf readers/exporters, none of them really worked good, exept one - forgot the name - but it didn't allow to save as pixel file...
finally i installed acrob...9, it crashes and can't export bigger than 8000px width.
and
when i do the whole script with rect  instead of ellipse, it looks very strane as pdf, goes all to the lower left corner with fills...?
Page Index Toggle Pages: 1