Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D processing sketches do not work #104

Open
jonathanperret opened this issue Nov 11, 2017 · 1 comment
Open

3D processing sketches do not work #104

jonathanperret opened this issue Nov 11, 2017 · 1 comment

Comments

@jonathanperret
Copy link
Owner

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.

@juliendorra
Copy link
Collaborator

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants