Hello,
I am working on little 3D project in processing and to do so i have create a cube using vertex (i don’t use box cause i want to be able to hide each face of the cube indivdualy) and i was wondering if it’s possible to render only one side of a vertex cause i don’t need to render the side inside of the cube.
I want to hide the face inside to optimize the performance so if you have any idea that could work I am curious.
ps : i am frensh so if my english is weird by momment i am sorry.
public void display()
{
beginShape();
texture(img);
vertex(coBlock.x, coBlock.y+size, coBlock.z, coTexture.x, coTexture.y);
vertex(coBlock.x+size, coBlock.y+size, coBlock.z, coTexture.x, coTexture.y+sizeTexture);
vertex(coBlock.x+size, coBlock.y+size, coBlock.z+size, coTexture.x+sizeTexture, coTexture.y+sizeTexture);
vertex(coBlock.x, coBlock.y+size, coBlock.z+size, coTexture.x+sizeTexture, coTexture.y);
endShape();
beginShape();
texture(img);
vertex(coBlock.x, coBlock.y, coBlock.z, coTexture.x+sizeTexture, coTexture.y+sizeTexture);
vertex(coBlock.x+size, coBlock.y, coBlock.z, coTexture.x+sizeTexture*2, coTexture.y+sizeTexture);
vertex(coBlock.x+size, coBlock.y+size, coBlock.z, coTexture.x+sizeTexture*2, coTexture.y);
vertex(coBlock.x, coBlock.y+size, coBlock.z, coTexture.x+sizeTexture, coTexture.y);
endShape();
beginShape();
texture(img);
vertex(coBlock.x, coBlock.y, coBlock.z, coTexture.x+sizeTexture*2, coTexture.y+sizeTexture);
vertex(coBlock.x, coBlock.y+size, coBlock.z, coTexture.x+sizeTexture*2, coTexture.y);
vertex(coBlock.x, coBlock.y+size, coBlock.z+size, coTexture.x+sizeTexture*3, coTexture.y);
vertex(coBlock.x, coBlock.y, coBlock.z+size, coTexture.x+sizeTexture*3, coTexture.y+sizeTexture);
endShape();
beginShape();
texture(img);
vertex(coBlock.x+size, coBlock.y, coBlock.z, coTexture.x+sizeTexture*3, coTexture.y+sizeTexture);
vertex(coBlock.x+size, coBlock.y+size, coBlock.z, coTexture.x+sizeTexture*3, coTexture.y);
vertex(coBlock.x+size, coBlock.y+size, coBlock.z+size, coTexture.x+sizeTexture*4, coTexture.y);
vertex(coBlock.x+size, coBlock.y, coBlock.z+size, coTexture.x+sizeTexture*4, coTexture.y+sizeTexture);
endShape();
beginShape();
texture(img);
vertex(coBlock.x, coBlock.y, coBlock.z+size, coTexture.x+sizeTexture*4, coTexture.y+sizeTexture);
vertex(coBlock.x+size, coBlock.y, coBlock.z+size, coTexture.x+sizeTexture*5, coTexture.y+sizeTexture);
vertex(coBlock.x+size, coBlock.y+size, coBlock.z+size, coTexture.x+sizeTexture*5, coTexture.y);
vertex(coBlock.x, coBlock.y+size, coBlock.z+size, coTexture.x+sizeTexture*4, coTexture.y);
endShape();
beginShape();
texture(img);
vertex(coBlock.x, coBlock.y, coBlock.z, coTexture.x+sizeTexture*5, coTexture.y);
vertex(coBlock.x+size, coBlock.y, coBlock.z, coTexture.x+sizeTexture*6, coTexture.y);
vertex(coBlock.x+size, coBlock.y, coBlock.z+size, coTexture.x+sizeTexture*6, coTexture.y+sizeTexture);
vertex(coBlock.x, coBlock.y, coBlock.z+size, coTexture.x+sizeTexture*5, coTexture.y+sizeTexture);
endShape();
}