Is it possible to create a BufferGeometry without setting the indices and still have the geometry rendered correctly? I followed the instructions here, but when I try, I receive a warning stating "Render count or primcount is 0" and the geometry doesn't show up. What could be causing this issue?
Below is the code snippet that reproduces the problem:
var buffGeometry = new THREE.BufferGeometry();
buffGeometry.attributes =
{
position:
{
itemSize: 3, array: new Float32Array([10, 0, 0, 0, 10, 0, 0, 0, 0, 0, 10, 0, 10, 0, 0, 10, 10, 0]),
numItems: 18
}
};
indexArray = new Uint32Array([0, 1, 2, 3, 4, 5]);
< !--it works adding the index array with the following line-- >
// buffGeometry.setIndex(new THREE.BufferAttribute(indexArray, 1));
material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
var mesh = new THREE.Mesh(buffGeometry, material);
scene.add(mesh);
Using three.js r77
(Here is the complete sample)