ListPlot3D with individual colours for each point that blend
Use the option VertexColors
with ListPlot3D
:
ListPlot3D[points[[All, ;; 3]],
Mesh -> None, BoxRatios -> 1,
Lighting -> "Neutral",
VertexColors -> (RGBColor @@@ points[[All, 4 ;;]])]
SeedRandom[1]
points2 = RandomReal[1, {20, 6}];
ListPlot3D[points2[[All, ;; 3]],
Mesh -> None, BoxRatios -> 1, Lighting -> "Neutral",
VertexColors -> (RGBColor @@@ points2[[All, 4 ;;]])]
Here's a starting point, which you can customize to your needs:
colourListPlot3D[data_, opt : OptionsPattern[]] :=
Module[{pts2d = data[[All, 1 ;; 2]]},
Graphics3D[
GraphicsComplex[data[[All, 1 ;; 3]],
MeshCells[DelaunayMesh[pts2d], 2],
VertexColors -> data[[All, 4]]
],
opt
]
]
I am assuming an input in the format data = {{x1, y1, z1, color1}, ...}
.
points = {{0, 0, 0, 1, 0, 0}, {1, 0, 0, 0, 1, 0}, {1, 1, 1, 0, 0, 1}};
data = {#1, #2, #3, RGBColor[##4]} & @@@ points;
colourListPlot3D[data]