Problems with old code in Processing 3.0

Hello everyone, I’m new here. Sorry for my english, I’m from Spain.

I have problems displaying a code that was written on a Imac 2009 in processing 3.0.

Now I work with Mac Air with an M1 processor and when I run the code it doesn’t display correctly. On the contrary, the generated PDF looks correct. Any help, please?

import processing.pdf.*;

PShape objecte;

float angle =0;
float x = 0;
float y = 0;
float rad;
float scalarx=1.001;
float scalary=1.001;
float blue = 200;
float red = 20;
float green = 20;

void setup() {
  size(858,1200,P2D);
  beginRecord(PDF,"cargola.pdf");
  background(0);
  smooth();
  noLoop();
  shapeMode(CENTER);
  objecte = loadShape("objectex.svg");
  
    } 


void draw() {
  
   translate(width/2-250,height/2);
   
   for (int i = 0; i < 480;i++) {
   rad = radians(angle);
   objecte.disableStyle();
   noFill();
   stroke(red, green, blue,50);
   strokeWeight(0.8/scalarx);
   pushMatrix();   
   translate(x,y); 
   rotate(rad);
   scale(scalarx,scalary);
   shape(objecte,0,0,430,215);
 
   scalarx+=0.0007;
   scalary-=0.01;
   angle +=0.25;
   x += 0.1;
   y -= random(0,2);
  blue += scalarx*0.3;
  red += scalarx*0.4;
  green += scalarx*0.3;
   
       
    popMatrix();
   } 
    
  endRecord();   
   
}
1 Like

hi,
it looks P2D is the cause , remove it or P3D made it works (processing 4.2, apple m1) :

size(858,1200);

well, kind of work, as i m not sure what to expect but it looks good (;
i can’t say why it s different for all renders

Hello
thanks for the help, with the P3D render it works but it doesn’t look like it did in the old version of Processing or in the PDF image that attach here. Also, sorry that I said that it was written in Processing 3.0 and actually was Processing 2.2.1.

What would happen if I install on the Mac Air M1 an older version of Processing?

Thank you!

Try it and then report back.

hi,

processing doesn t really need install, so you can test all of them,
i didn’t use version 2 but i use 3.5.4 quite often (only hack on m1 is you have to set a framerate in setup to get an image)
it looks to me i have more problems with ventura than i had with monterey, with old libraries
for those peticular libraries i use the intel version of 4.2 in place of arm version, it s slower to launch but otherwise run quite same