相关疑难解决方法(0)

很难用glDrawElements理解索引

我试图绘制地形与GL_TRIANGLE_STRIPglDrawElements,但我有一个很艰难的时间去了解背后的东西指数glDrawElements...

这是我到目前为止所拥有的:

void Terrain::GenerateVertexBufferObjects(float ox, float oy, float oz) {
    float startWidth, startLength, *vArray;
    int vCount, vIndex = -1;

    // width = length = 256

    startWidth = (width / 2.0f) - width;
    startLength = (length / 2.0f) - length;

    vCount = 3 * width * length;
    vArray = new float[vCount];

    for(int z = 0; z < length; z++) {
        // vIndex == vIndex + width * 3  ||  width * 3 = 256 * …
Run Code Online (Sandbox Code Playgroud)

opengl vertex-buffer indices vertex-array

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

indices ×1

opengl ×1

vertex-array ×1

vertex-buffer ×1