I've been diving into a three.js codebase.
While studying the code and the documentation, there's one thing that's puzzling me.
In this particular code snippet. http://jsfiddle.net/w67tzfhx/
there exists the following piece of code.
function init(){
var geometry = new THREE.BufferGeometry();
var positions = new Float32Array(MAX_POINTS*3);
geometry.addAttribute('position',new THREE.BufferAttribute(positions,3))
drawCount =2;
geometry.setDrawRange(0,drawCount );
mat = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 2 } );
line= new THREE.Line(geometry, mat)
scene.add(line)
updatePositions();
}
What exactly is setDrawRange? And how does drawCount function in this context?
The official documentation explains it as:
.setDrawRange ( start : Integer, count : Integer ) : null Set the .drawRange property. For non-indexed BufferGeometry, count represents the number of vertices to render. For indexed BufferGeometry, count signifies the number of indices to render.
which I find somewhat confusing.
Would appreciate any insights into clarifying what this means. Many thanks in advance.