paysage icon indicating copy to clipboard operation
paysage copied to clipboard

3D processing sketches do not work

Open jonathanperret opened this issue 7 years ago • 1 comments

Here's a basic sketch using Processing.js's 3D capabilities:

void setup() {
  size(300, 300, P3D);
}

void draw() {
  lights();
  background(0);

  translate(width/2, height/2, 0);
  rotateX(-0.5);
  rotateY(millis()/1000.0);
  box(100);
}

When pasted into Paysage, this fails with an error on modelView.rotateX. This is Processing.js's way of telling us that the 3D mode initialization failed.

Actually, what happens is that the Paysage renderer calls size() by itself to fill the rendering area, without specifying a rendering mode, which is the same as specifying P2D. This used to be done after setup() ran, which meant a size() call from setup() could set the mode to P3D, but this caused issue #68, so we moved the size() call earlier. And given that it is not possible to change the rendering mode once it is set, this precludes running P3D sketches.

Note that in a similar fashion, our preemptive background() call (the fix for #76) probably also forces the sketch in P2D mode.

jonathanperret avatar Nov 11 '17 16:11 jonathanperret

Should we consider this a Won't Fix?

I'm quite satisfied with Paysage being a 2D tool.

The only issue I can see is that a growing number of people expect Processing sketches to work in 3D, and we directly point them from the programmer to a reference that includes 3D commands!

Maybe we add this to version 2 roadmap? (p5js, bug report in the editor, 3D, etc.)

juliendorra avatar Nov 11 '18 16:11 juliendorra