I'm working on a project in three.js where I have a line passing through points of a particle cloud. Currently, I am using a canvas renderer and looking to add some randomness by varying the color of the line from vertex to vertex. I came across an example that demonstrated this concept:
However, after spending hours trying to adapt it to my simpler scenario, I haven't been able to figure out how to adjust just the colors of the line. The ThreeJS documentation on vertexMaterial is unhelpful, and the information on lines only discusses adjusting the color of the line as a whole (line.material.color).
My current code looks like this:
line = new THREE.Line( geometry, new THREE.LineBasicMaterial( { color: lineColor, opacity: lineVars.lineOpacity } ) );
If anyone has a simpler explanation or solution for how to achieve random color variations on the line, I would greatly appreciate your help.