The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: triangle color knowing the color of vertices
Replies: 1   Last Post: Mar 25, 2013 10:48 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Steven Lord

Posts: 18,038
Registered: 12/7/04
Re: triangle color knowing the color of vertices
Posted: Mar 25, 2013 10:48 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Mario Stella" <> wrote in message
> 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.

Steve Lord
To contact Technical Support use the Contact Us link on

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.