Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: triangle color knowing the color of vertices
Posted:
Mar 25, 2013 10:48 AM


"Mario Stella" <heisheis88@yahoo.com> wrote in message news:kip6l0$hqr$1@newscl01ah.mathworks.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?
http://en.wikipedia.org/wiki/Color_mixing
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 NumberOfVertices > > NumberOfTriangles
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.
 Steve Lord slord@mathworks.com To contact Technical Support use the Contact Us link on http://www.mathworks.com



