Grasshopper

algorithmic modeling for Rhino

Dear All,

Could please somebody advise me how it is possible to add color to a vertexes

mesh.VertexColors.SetColor(System.Drawing.Color.Red)

Thanks!

Dimitry

Views: 423

Replies to This Discussion

Hi Dimitry,

you can use Mesh.VertexColors.Add() to add a bunch of colours in a loop, or you can compute an array of colours first and then use AppendRange() instead.

Another possibility is to create a Monotone mesh first and then specifically assign certain indices:

Mesh mesh = GetMeshFromSomewhere();

mesh.VertexColors.CreateMonotoneMesh(Color.White);

mesh.VertexColors[0] = Color.Black;

mesh.VertexColors[3] = Color.Red;

etc.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you David, very helpful!

Attachments:

You can also set the Count of VertexColors (mesh.VertexColors.Count = 100) and then set each member.

- Giulio
________________
giulio@mcneel.com

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service