wpf.net-5helix-3d-toolkit

How to color each point of a Mesh3D differently using the helixtoolkit?


I'm using the helixtoolkit for WPF and I'd like to set the color of each point of a Mesh3D. Is something like this possible?

The reason I need to do so is because I display a polar diagram in 3D (I convert the polar coordinates into carthesian) and I'd like that every point is colored depending on the distance to the origin. Is there any way to do this?

Thanks in advance!


Solution

  • You can use texture coordinate to assign each vertex a texture value, then assign a color gradient map as diffuse map to a PhongBlinn material. Or if you are using Helixtoolkit sharpdx version, you can assign vertex color directly and use VertColorMaterial.