First, in your image the diagonals are actually upside down if the numbers represent the order of the vertices (but this is a small representation error).
This is the easiest and most suitable approach for removing a more or less uniform grid of vertices. You are right that 10 and 3 need the same normal condition, so you need to give them the same normal condition for proper lighting. In this case, indexing is your friend. Just use one vertex for 3 and 10 (with the corresponding normal) and use an indexed triangular strip where indices 3 and 10 refer to the same vertex. This is the standard way to solve vertex ambiguities. If you donβt know what I mean, go a little deeper into OpenGL and 3D programming in general, especially vertex and index arrays.
For regular grids, strips are often a good idea because they can be easily built. More complex grids are no longer required at this time, since it is often important to reduce the number of callbacks.
They should have at least a reasonable length compared to the total number of triangles, otherwise the overhead of drawing one strip just outweighs the time spent on a little faster processing of the vertices, but the actual numbers are very implementation dependent. You should use vertex arrays / buffers anyway, avoid start / end if you care about performance.
In fact, you can combine several bands into one by introducing degenerate triangles that are not displayed (to reduce the number of drawing calls). Your example may display as the following single bar:
1, 2, 3, 4, 5, 6, 6, 7 , 7, 8, 9, 10, 11, 12
But then again, keep the answer 3. in mind. The stripes should be of a reasonable size so that degenerate triangles do not overload real triangles too much.
Christian rau
source share