Applying a texture to a Curve


I made a Curve from an array of Vector3f, and then made a Geometry out of it and added it to a scene.

It looks good (it goes around the 3d scene like a strand of thread), but it is always a single color throughout its length.

Can I make it look more vivid, where each line segment is colored such that the first 70% of its length is one color, and the rest 30% is another, or something like that?

I tried setting the Material to a ColoredTextured backed by a PNG image having two colors, but it always just picks up the first pixel in that PNG image and renders the whole Curve with that color.



I’m sure I’ve read an example somewhere that had each vertex on a mesh set to a specified colour and then each face was interpolated between them. Can’t remember where it was now though but if JME3 supports that it sounds like what you need…