javascript - Using Three.js (r78), how to transition line material color between two values along a path? -
i thought understood example, attempt @ applying code produces solid black lines. please me understand why might not working?
function(ptarray) { var geometry = new three.buffergeometry(), material = new three.linebasicmaterial({ color: 0xffffff, linewidth: 4, vertexcolors: three.vertexcolors }), linepositions = new float32array(pts), linecolors = new float32array(pts), visible = new float32array(pts / 3); visible.fill(1.0); (var p = 0; p < pts; p ++) { linepositions[p] = ptarray[p]; linecolors[p] = new three.color(0xffffff).sethsl(p/pts, 1.0, 0.5); } geometry.addattribute('position', new three.bufferattribute(linepositions, 3)); geometry.addattribute('vertcolor', new three.bufferattribute(linecolors, 3)); geometry.addattribute('visible', new three.bufferattribute(visible, 1)); scene.add(new three.linesegments(geometry, material); }
Comments
Post a Comment