Here are the solution for your problems: Since your camera near and far view is between 0.1 and 1000
var camera = new THREE.PerspectiveCamera(75, window.innerWidth/window.innerHeight, 0.1, 1000);
Then your vertices z position must be in between that range. Therefore, please change your code from
positions[ i + 2 ] = 0;
to
positions[ i + 2 ] = 1;
Also, your code seem to be missing these parts:
geometry.addAttribute( 'index', new THREE.BufferAttribute( indices, 3 ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) );
geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
for the full fixed code, please refer it here: http://learn-daily.com/three-js-drawing-flying-triangle-using-buffergeometry/