나는 얼굴 인덱스 (포인트를 가리킴)와 포인트를 가지고 있으며 루프 안에 삼각형을 그려야합니다.webGL을 사용하는 drawElements
for(var i=1;i<38000;i++){
var vtx = new Float32Array(
[points[faces[i][1]][1],points[faces[i][1]][2],points[faces[i][1]][3],
points[faces[i][2]][1],points[faces[i][2]][2],points[faces[i][2]][3],
points[faces[i][3]][1],points[faces[i][3]][2],points[faces[i][3]][3]
]
);
var idx = new Uint16Array([0, 1]);
initBuffers(vtx, idx);
gl.lineWidth(1.0);
gl.uniform4f(shaderProgram.colorUniform, 0, 0, 0, 1);
gl.drawElements(gl.LINES, 3, gl.UNSIGNED_SHORT, 0);
unbindBuffers();
}
}
이 루틴은 아무것도 그리지 않습니다
WebGL: drawElements: bound element array buffer is too small for given count and offset
이 내 코드입니다 : 웹 콘솔 날이 오류를 제공합니다. 어떻게 해결할 수 있습니까?