OpenGL ES 索引问题
我是 OpenGL ES 新手,我需要知道我们如何使用索引,因为我不明白我们使用的数字?
I am new to OpenGL ES and I need to know how we use the indices in that I didn't understand the numbers we used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嗯,索引用于描述顶点的绘制顺序。
当您必须绘制一个由许多顶点组成但其中许多是相同点的对象时,这非常有用。
因此,例如,当你想用 glDrawElements(带索引)绘制一个正方形时,你有
另一方面,如果你想用 glDrawArrays(不带索引)绘制一个正方形,你有
Well ,the indices are used to describe in what order the vertices should be drawn.
This is usefull when you have to draw an object which is consisted by many vertices but many of them are the same points.
So for example when you want to draw a square with glDrawElements(with indices) you have
In the other hand if you want to draw a square with glDrawArrays(without indices) you have
本文
这可能会帮助您了解指数。在代码中我们使用这个结构:
This article
this may help you get an idea about indices. In code we use this structure: