OpenGL Mapping Textures to a Grid Stored Inside Vertex Array
Posted
by
Matthew Hoggan
on Stack Overflow
See other posts from Stack Overflow
or by Matthew Hoggan
Published on 2012-09-09T03:27:25Z
Indexed on
2012/09/09
3:38 UTC
Read the original article
Hit count: 159
I am writing a test to verify something. This is not production code, just verification code. So I would appreciate it if the specific question was answered.
I have code that uses indices and vertices to draw a set of triangles in the shape of a grid. All the vertices are drawn using glDrawElements(). Now for each vertex I will set its corresponding Texture Coordinates to 0 or 1 for each set of triangles that form a square in the grid. Basically I want to draw a collage of random textures in each one of the "squares" (consisting of two triangles). I can do this using the glBegin()
and glEnd()
method calls inside a for loop using the fixed functional pipeline, but I would like to know how to do this using Vertex Arrays.
© Stack Overflow or respective owner