opengl - Is there any way to make a row of tiles work with GL_QUAD_STRIP? -
If I want to draw a line of 2D square tiles for a game, then the obvious way is to use GL_QUADS and 4 is to specify the top and texture coordinates for each tile but since it is a line of square tile, the last two coordinates of each class are two of the next one over, which is actually designed to look like GL_QUAD_STRIP is. You are not repeating all the interior corners in the end.
The problem comes when you try to apply the texture when you attract them as the "end" of the quad, the texture coordinates are already bound, but when you If you want to reuse the last two as the beginning of the next quad, you do not need to reassign them to the new textured coordinates. The tile you use is directly near the tile which you Sector Tailset texture of went last tile used.
Is there any way to do this work? Or do you just have to live with GL_QUADS and repeat them twice?
Later versions of OpenGL have to restart primitive while drawing from an array array Presented a way of. Specify what you do, special, dummy element indicator, which instead indicates an element in the array array indicates the beginning of a new primitive series, such as the Tradem Strip: < P> However, if you want to keep your tiles independently, they do not have a peak in the not share corner, it is assigned coordinates of textures and other features. So in reality you are not attracting a quad strip (which is on the edge of the stock) but independent quad.
Comments
Post a Comment