Error when using P3D Processing 3

edited May 2016 in Questions about Code

down vote favorite Could you please help me I am trying to start drawing 3D shapes using Processing 3 Whenever the renderer P3D is used, I get the following Error

ERROR: 0:2: '' : Declaration must include a precision qualifier or the default precision must have been previously declared. ERROR: 0:30: '' : Declaration must include a precision qualifier or the default precision must have been previously declared.

The piece of code I am trying to run:

float x,y,z;
void setup() {
  size(200,200,P3D);
  x = width/2;
  y = height/2;
  z = 0;
}

void draw() {
  translate(x,y,z);
  rectMode(CENTER);
  rect(0,0,100,100);

z++; // The rectangle moves forward as z increments.
}

Thank you

Tagged:

Answers

  • try OPENGL instead p3d

    ??

  • Still getting the same error

  • Have you tried creating a P2D sketch. P2D and P3D both use OpenGL for rendering. If the error occurs in both then check that you are using the latest OpenGL drivers on your graphics card.

  • The same problem with P2D. But I have tried Processing 2 and every thing was fine.

  • Then try reinstalling PS3

  • well, did opengl work in p2 or just p2d?

    update graphics driver?

  • yes it work in Processing 2. I have updated it but still nothing.

  • It might still be worth updating your graphic drivers. It could be PS3 using additional features of OpenGL not supported by your drivers.

  • edited May 2016

    try OPENGL instead P3D

    @Chrisir, even today haven't you realized that OPENGL became a mere alias for P3D once Processing 2 arrived? 8-| println(OPENGL == P3D); // false for P1, otherwise true.

  • I know, same

Sign In or Register to comment.