In processing you can create 3D shapes quite easily by just giving vertex positions in a certain order.
Example for a simple square:
beginShape();// QUAD would work as parameter
vertex(10,10);
vertex(20,10);
vertex(20,20);
vertex(10,20);
endShape();
What I am wondering is if I want to create multiple quads that forms a bigger square(ie some of the quads share corners), should I create the smaller quads by themselves and thus create overlapping vertices or is there a way to just define the vertices that I then can use for multiple quads without creating new ones at the same position?
Example:
X:1, 2
+---+---+ Y:
| | |
| | | 1,
+---o---/
| | |
| | | 2
+---+---+
The middle corner shared between all the quads (marked 'o') will have 4 vertices overlapping from all the neighbouring quads. The rightmost middle vertex point (marked '/') will have 2 vertices overlapping from the quads at (2,1) and (2,2)
Isn't this very inefficient when it comes to vertexcount?
This might be the way OpenGL works but in my mind this does not seem very efficient, if I'm wrong please tell me.