Beginshape in 3d using curveVertex does not render the fill completely
in
Programming Questions
•
7 months ago
I'm currently working on a project which I want to have in browser and noticed that some shapes do not render completely. I figured out that it seems to be related to shapes using beginShape and CurveVertex.
this is the basic problem:
If you run the following code in JAVA mode all is well and beautifull (at least you should see a red shape)
In JAVASCRIPT mode however only a few of the shapes triangles are rendered (one to the right and a few small ones in the corners)
Does anybody know a solution to this problem?
Thanks!
void setup() {
size (400, 400, P3D );
}
void draw(){
background(255);
fill(255,0,0);
stroke(0,255,0);
beginShape();
curveVertex(50,50,0);
curveVertex(50,50,0);
curveVertex(350,50,0);
curveVertex(350,350,0);
curveVertex(50,350,0);
curveVertex(50,350,0);
endShape(CLOSE);
}
this is the basic problem:
If you run the following code in JAVA mode all is well and beautifull (at least you should see a red shape)
In JAVASCRIPT mode however only a few of the shapes triangles are rendered (one to the right and a few small ones in the corners)
Does anybody know a solution to this problem?
Thanks!
void setup() {
size (400, 400, P3D );
}
void draw(){
background(255);
fill(255,0,0);
stroke(0,255,0);
beginShape();
curveVertex(50,50,0);
curveVertex(50,50,0);
curveVertex(350,50,0);
curveVertex(350,350,0);
curveVertex(50,350,0);
curveVertex(50,350,0);
endShape(CLOSE);
}
1