I would like to plot a Graphics3D
object colored based on the value of some spatial function. For example to plot a triangle colored by the function cf
I might start with:
testCorners = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
testTriangle = Triangle[testCorners];
cf [{x_, y_, z_}] = ColorData["NeonColors"][z];
I hope that there is a couple of lines, probably involving Graphics3D that will plot this triangle (or other, more complicated surfaces) colored with the function I have specified (or other more complicated functions of x, y, and z).
I can do fun stuff like color vertices and have Mathematica linearly interpolate over the faces.
Graphics3D[
Append[PolyhedronData["Dodecahedron", "GraphicsComplex"],
VertexColors -> ColorData["NeonColors"] /@ RandomReal[{0, 1}, 20]]]
It may be possible to use a similar method by transforming the surface into a GraphicsComplex
object and then setting VertexTextureCoordinates
appropriately and supplying a Texture
to Graphics3D
, but that seems quite complicated...