I was going through the signature of the method glVertexPointer
which is
void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
Can anyone help me understand what does the third argument stride
do.
I got this definition for stride
after googling about it
Amount of bytes from the beginning of one element to the beginning of the following element. If you pass a zero as stride, it means they are tightly packed. If you have an array of floats, which contains vertices like this, x1,y1,z1,x2,y2,z2... and so on, you can set stride to either zero (as tightly packed), or 12 (3 floats*4 bytes each from the beginning of vertex one to the beginning of vertex two).
I am not able to get what does this mean ? it would be really helpful if someone explains it with the help of an example.
thanks.