【发布时间】:2014-03-10 09:36:11
【问题描述】:
我正在检查方法glVertexPointer的签名,即
void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
谁能帮我理解第三个参数stride的作用。
在谷歌搜索后,我得到了stride 的这个定义
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).
我无法理解这是什么意思?如果有人借助示例进行解释,那将非常有帮助。
谢谢。
【问题讨论】: