I tried to create a plane with a hole in the middle. It works with the example on the documentation, but I don’t succeed to make it work with my values. Is there any constraint on values?
Here is my code:
float x = 980;
float y = 280;
void setup() {
size(900, 900, P3D);
}
void draw() {
translate(200,200);
createShape();
beginShape();
textureMode(NORMAL);
shininess(200);
emissive(0, 0, 0);
normal(0, 0, 1);
vertex(-x/2, -y/2, 0, 0);
vertex(x/2, -y/2, 1, 0);
vertex(x/2, y/2, 1, 1);
vertex(-x/2, y/2, 0, 1);
beginContour();
vertex(-x/2+115, -y/2+35, 0, 0);
vertex(x/2-115, -y/2+35, 1, 0);
vertex(x/2-115, y/2-105, 1, 1);
vertex(-x/2+115, y/2-105, 0, 1);
endContour();
endShape(CLOSE);
}
Can you help me please?