problem with fill non-convex shape in P3D mode

edited April 2014 in JavaScript Mode

Hi, all

I am trying to draw a flat non-convex custom shape and fill it in P3D mode in javascript mode.

e.g.

void setup(){
  size(500,500,P3D);
  }
void draw(){
  background(255);
  fill(255,0,0);
  beginShape();
  vertex(100,100,0);
  vertex(100,200,0);
  vertex(150,300,0);
  vertex(160,300,0);
  vertex(110,200,0);
  vertex(110,100,0);
  endShape(CLOSE);  
}

However, it shows ok in java mode or p2d jsmode, but display abnormal in p3d jsmode. They look like these.

javamode

p2djsmode

p3djsmode

Is there any way to fix these in p3d javascript mode?

Thanks

Sign In or Register to comment.