"Mario Stella" <firstname.lastname@example.org> wrote in message news:email@example.com... > Good morning everybody, > > I have a list of points (vertices) in a 3D space. I have also a list of > adjacent triangles that have those points as vertices, forming a surface > in the same space. > Each vertex has a scalar value associated with it (color).
An index into a colormap?
> I would like to know, is there any standard, fast, reliable way to find > the color to associate to the triangle, being know the colors of its > vertices?
What color would be associated with a triangle whose vertices are pure red, pure green, and pure blue? Should it be pure red, pure green, pure blue (in these three cases, one of the vertices "win" over the other two based on some criterion of your choice), black (subtractive mixing), white (additive mixing), or a different color?
Without knowing anything about your desired mapping properties about the only answers we could give would be trivial, like "All the triangles are associated with black."
> More specifically, can the sum of the color values of the triangles equal > the sum of the colors values of the vertices? note that Number-Of-Vertices > > Number-Of-Triangles
Now you're starting to get into mathematical puzzle territory. You could do this by letting each triangle's color value be the sum of (each vertex's color value divided by the number of triangles containing that vertex.) Whether that would satisfy your other requirements, or make sense in the context of your problem, is unclear. There's no universal mapping from colors to scalar values and you haven't told us anything about the mapping YOU'RE using.