After dynamically updating the vertices of lineGeometry of Line2, line segment colors are not displayed


In the first half of this video, lines were drawn using new Line(BufferGeometry, lineBasicMaterials).In the second half of this video, lines were drawn using new Line2(LineGeometry, LineMaterials).
The logic of this code is to create two overlapping points when you start drawing a line, and update the position of the last point as you move the mouse. After the left mouse button, insert a dot before the last dot, move the mouse to update the position of the last dot, and so on.
I don’t understand why all the other lines have no color except the first one is good.

I solved this problem by looking at this post, if you have the same problem as me, I hope it can help you

This topic was automatically closed after 30 days. New replies are no longer allowed.