Peasycam 3d Rendering Issue mac

hi all,
i am totally new to processing3 so i apologize in advance if this is a simple issue.
i am trying to render the lorenz attractor. I am able to model it in 2D with this code

float x = 0.01;
float y = 0;
float z = 0;
float a = 10;
float b = 28;
float c = 8.0/3.0;

void setup() {
  size(800, 650);
  background(0);
}

void draw() {

  float dt = 0.01;
  float dx = (a * (y - x))*dt;
  float dy = (x * (b - z) - y)*dt;
  float dz = (x * y - c * z)*dt;
  x = x + dx;
  y = y + dy;
  z = z + dz;

  translate(width/2, height/2);

  scale(10);
  stroke(255);
  point(x, y);
}

when i switch to doing a 3D render I get this error

0   AppKit                              0x00007fff22c6247f -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 352
	1   AppKit                              0x00007fff22c4d121 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1375
	2   AppKit                              0x00007fff22c4cbbb -[NSWindow initWithContentRect:styleMask:backing:defer:] + 42
	3   libnativewindow_macosx.jnilib       0x000000012cbc93fe Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 398
	4   ???                                 0x00000001159cba88 0x0 + 4657560200
)

this is my code

import peasy.*;
float x = 0.01;
float y = 0;
float z = 0;
float a = 10;
float b = 28;
float c = 8.0/3.0;

ArrayList<PVector> points = new ArrayList<PVector>();
PeasyCam cam;

void setup() {
  size(800, 600, P3D);
  background(0);
  colorMode(HSB);
  cam = new PeasyCam(this, 500);
}

void draw() {

  float dt = 0.01;
  float dx = (a * (y - x))*dt;
  float dy = (x * (b - z) - y)*dt;
  float dz = (x * y - c * z)*dt;
  x = x + dx;
  y = y + dy;
  z = z + dz;

  points.add(new PVector(x, y, z));
  
  translate(0, 0, -80);
  scale(5);
  stroke(255);
  point(x,y);
  noFill();

  float hu = 0;
  beginShape();
  for (PVector v : points) {
    stroke(hu, 255, 255);
    vertex(v.x, v.y,v.z);

    hu += 0.1;
    if (hu > 255) {
      hu = 0;
    }
  }
  endShape();
}

I have Processing 3.5.4 running on
MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports)
Processor 1.4 GHz Quad-Core Intel Core i5
Graphics Intel Iris Plus Graphics 645 1536 MB

hi,

your code works very well, i guess you re on big sur, you need to add frameRate(24); in your setup(){}
or the windows does not initialise at all

it’s a weird behaviour on big sur, as the error message you got, it will remain but sketch will run as usual

very nice code, i love it (i added background(0); in the draw loop for personnal taste)

1 Like

hi th75,

Thank you so much !!! <3
I added what you suggested and it works in 3D!!!
however…
despite the program running this error still remains. Do you think this is a non-issue. Does the same show up for you as well?

0   AppKit                              0x00007fff22c6247f -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 352
	1   AppKit                              0x00007fff22c4d121 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1375
	2   AppKit                              0x00007fff22c4cbbb -[NSWindow initWithContentRect:styleMask:backing:defer:] + 42
	3   libnativewindow_macosx.jnilib       0x000000012d3083fe Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0 + 398
	4   ???                                 0x0000000119d3aa88 0x0 + 4728269448
)

Once again, thank you so much :slight_smile:

yep i have this same message on every sketch, but it doesn t change how it works…

some other stuff doesn t work properly since big sur, like accessing the video and the micro

let s hope Processing 4 will succeed to fix that