Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8530

Color desired mesh faces

$
0
0

@pouryatorabi wrote:

Hi every one.
I have a mesh file in Rhino and just want to change the color of some specific mesh faces to red. First I tried to see what is the color of the mesh with:

foreach (Color color in mesh.VertexColors)
{
Debug.WriteLine(“Color is :”);
Debug.WriteLine(color);
}
It shows nothing as if the mesh is colorless. Then I tried to color the whole mesh with:
System.Drawing.Color colors = new System.Drawing.Color[mesh.Vertices.Count];
System.Drawing.Color colors = new System.Drawing.Color[mesh.Vertices.Count];
for (int i = 0; i < mesh.Vertices.Count; i++)
{
colors[i] = System.Drawing.Color.Red;
}
mesh.VertexColors.SetColors(colors);

And then again tried to see if the colors are set with:

foreach (Color color in mesh.VertexColors)
{
Debug.WriteLine(“Color is :”);
Debug.WriteLine(color);
}
It prints the red color at the console but the color of the mesh won’t change in the Render. What should I do to change the color in the render?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 8530

Trending Articles