Different edges color in same cube?


Could anyone give some suggestions for the below question?

I added edges to my cube through using THREE.lineSegments and THREE.EdgesGeometry.

I am wondering how to set the different edges of the same cube with a different color.

Currently, I use THREE.LineBasicMaterial to set color.


We lately discussed a similar issue at stackoverflow:

Short answer: You can render your line segments with an additional color geometry attribute and by setting Material.vertexColors to THREE.VertexColors.