关于glVertexAttribPointer的用法
GLfloat m_tex[3][4][2] = { { {{1.0, 2.0}, {2.0, 3.0}}, {{0.0, -3.0}, {9.0, 11.0}}, {{23.0, 12.0}, {43.0, 22.0}}, {{15.0, 4.0}, {3.0, 12.0}} },
{ {{13.0, 4.0}, {56.0, 3.0}}, {{5.0, 9.0}, {3.0, 5.0}}, {{3.0, 1.0}, {4.0, 9.0}}, {{5.0, 4.0}, {7.0, 12.0}} },
{ {{3.0, 9.0}, {6.0, 13.0}}, {{8.0, 19.0}, {13.0, 6.0}}, {{3.0, 3.0}, {9.0, 6.0}}, {{35.0, 7.0}, {13.0, 12.0}} }
};
glVertexAttribPointer(Yloc, 2, GL_FLOAT, 0, 0, m_tex[0]);
glVertexAttribPointer(Uloc, 2, GL_FLOAT, 0, 0, m_tex[1]);
glVertexAttribPointer(Vloc, 2, GL_FLOAT, 0, 0, m_tex[2]);
我知道glVertexAttribPointer
的意思。它集m_tex[0]
2的值浮到顶点Yloc
但m_tex[0]
包括:关于glVertexAttribPointer的用法
{{1.0, 2.0}, {2.0, 3.0}}, {{0.0, -3.0}, {9.0, 11.0}}, {{23.0, 12.0}, {43.0, 22.0}}, {{15.0, 4.0}, {3.0, 12.0}}
所以没有考虑前两个人? {1.0,2.0}
我不确定。
回答:
是,这将需要在每次迭代
+-----------------------------------------------------------+ | glVertexAttribPointer(Yloc, 2, GL_FLOAT, 0, 0, m_tex[0]); |
+-----------------------------------------------------------+
| |
take 2 floats each time <+ from this set <-+
[1.0,2.0]
两个数如果更改2参数3它将迭代为成分〔X,Y,Z]
+-----------------------------------------------------------+ | glVertexAttribPointer(Yloc, 3, GL_FLOAT, 0, 0, m_tex[0]); |
+-----------------------------------------------------------+
| |
take 3 floats each time <+ from this set <-+
[1.0,2.0,2.0]
以上是 关于glVertexAttribPointer的用法 的全部内容, 来源链接: utcz.com/qa/262487.html