In my three.js project, I am working on drawing a line based on an array of vertices. One challenge I am facing is setting the color of the line to a specific value between two points along the line that are not actual vertices. These two points exist at a certain distance from the line's origin - for example, I want to change the color between 50 and 100 units along a line that is 500 units long. How can I achieve this?
Although using vertexColors: THREE.VertexColors
allows me to specify colors between line vertices, it does not help in coloring between non-vertex points. It seems like I might need to add these two points as additional vertices, but then comes the question of how to determine their position with XYZ coordinates along the line.
If you have any suggestions or hints on how I could accomplish this, I would greatly appreciate your input!