drawElements use
问题 I create a little application in WebGL, I have two objects which move, a cube and a sphere. I modify objects with shaders, each object have it shader. So I want update objects on the display at determine time, for this I use drawElements function. For each object I have a buffer which contains indices of faces in vertices buffer : gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(indices), gl.STREAM_DRAW); indexCount = indices