Gradient fill on 3D objects

Jun 6, 2013 at 9:46 PM
How do you go about doing a gradient fill on a tube? My attempts have been unsuccessful and only show the last listed color.
So if anyone can help, how would you give this tube a gradient?

TubeVisual3D tube1 = new TubeVisual3D();
tube1 .Path = new Point3DCollection();
tube1 .Path.Add(new Point3D(0, 0, 0));
tube1 .Path.Add(new Point3D(10, 10, 0));
tube1 .Diameter = 5;

Thanks for reading, and thank you for the toolkit.
Jun 7, 2013 at 11:10 AM
There should be a TextureCoordinates property on the TubeVisual3D. Set the texture coordinates for each point and use a gradient material!
See the StreamLines demo (but this demo uses the MeshBuilder, not the TubeVisual3D).
Jun 8, 2013 at 3:15 PM
Alright, got it! Thank you very much.
Jun 17, 2013 at 11:22 PM
Am I correct in understanding that since the TextureCoordinates property only tracks the X values, it's not possible for an object that moves up the Y axis only, with a static X value, to be painted with a gradient?

For reference, what I'm trying to do is to make certain points along a tube's path different colors.
Jun 18, 2013 at 9:05 PM
See MeshBuilder line 1927 where the texture coordinates are defined.
The x-value is set by the specified values (should be normalized 0..1), and the y value corresponds to the position around the tube.
Jun 19, 2013 at 7:37 PM
Thank you, I will look into this.
Your quick replies are much appreciated, by the way!