how to update codes written in processing2 for processing3?

edited October 2015 in Library Questions

I found a very interesting code on openprocessing. However, it won't run on processing3 with the following errors.

getMatrix is not available with this renderer.

camera(), or this particular variation of it, is not available with this renderer.

PeasyCam v0.92

directionalLight() is not available with this renderer.

ambientLight() is not available with this renderer.

sphere() is not available with this renderer.

vertex() with x, y, and z coordinates can only be used with a renderer that supports 3D, such as >P3D or OPENGL. Use a version without a z-coordinate instead.

I try to find libraries with peasyCam, there is one and I downloaded it, but still the same errors. Is it because those functions are not updated for processing3?

what is the easiest solution to these errors?

or should I install processing2 to run this code? but I couldn't find the place to download the older version of processing.

Thanks a lot

Answers

  • post the code.

    specifically the size() call - most of those errors are renderer related.

  • the code has five files and quite lengthy. you can download the code from http://www.openprocessing.org/sketch/199382

  • edited October 2015 Answer ✓

    When you downloaded the sketch from openprocessing, then there might be a "code"-folder within your sketch-folder. Try to remove it. Otherwise these jar-files could conflict with those of p3 or libraries that you have installed.

    Then there are two lines in setup() that seem to cause errors:

      hint(DISABLE_OPENGL_ERROR_REPORT);
      hint(ENABLE_OPENGL_4X_SMOOTH);
    

    Remove or comment the out.

  • Thanks @benja, I will give a try.

  • @benja, thank a million!!! It works! exactly as you said, we should remove code folder and comments the two lines of codes above. Thanks again :))

Sign In or Register to comment.