public void draw(float[] matrix) {
    heightmapProgram.useProgram();
    heightmapProgram.setUniforms(matrix);
    bindData();

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer.getBufferId());
    glDrawElements(GL_TRIANGLES, numElements, GL_UNSIGNED_SHORT, 0);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
  }
 public void bindData() {
   vertexBuffer.setVertexAttribPointer(
       0, heightmapProgram.getPositionAttributeLocation(), POSITION_COMPONENT_COUNT, 0);
 }