2
$\begingroup$

I have a confusion recently about the visualization of data with four dimension,like as {x,y,z,color}. This is my current solution.

data = Uncompress[FromCharacterCode[Flatten[ImageData[Import["https://i.stack.imgur.com/s1ZKU.png"],"Byte"]]]];
front = data[[All, 1 ;; 3]];
back = data[[All, 4]];
Graphics3D[Point[front, VertexColors -> Hue /@ Rescale[back]]]

the effect like the picture.

enter image description here

it is not my intention.i want get a cube whose color be determined by the fourth element of the list.

I have an another try like this.

Style[ConvexHullMesh[front]]

enter image description here

the shape is contented to me.But I cannot render it by what I want to.Can anybody help me?

$\endgroup$
3
  • $\begingroup$ Something like: 19575? $\endgroup$
    – Kuba
    Apr 25, 2015 at 13:48
  • $\begingroup$ @Kuba,yeah,thk your concern this problem.I have read that some times,but there are two difference,first,the first solution's point is not a face.the scene is same to my first picture. the scond solution 's data isn't a coordinates.so i want to get a new method. $\endgroup$
    – yode
    Apr 25, 2015 at 14:01
  • $\begingroup$ and all my data is the surface of a cube. $\endgroup$
    – yode
    Apr 26, 2015 at 3:47

2 Answers 2

4
$\begingroup$
Graphics3D[{EdgeForm[{}], 
GraphicsComplex[front, 
MeshCells[DelaunayMesh[front], 2], VertexColors -> Hue /@ back]}]

MeshCoordinates[DelaunayMesh[front]] == front

(*True*)

enter image description here

$\endgroup$
3
  • $\begingroup$ MeshCoordinates[front][[1]] is equivalent to front. $\endgroup$
    – LLlAMnYP
    Apr 27, 2015 at 12:45
  • $\begingroup$ @LLlAMnYP Hi, thanks for pointing out that, that might be a typo here though the same to front, my first try is MeshCoordinates[DelaunayMesh[front]] $\endgroup$ Apr 27, 2015 at 13:14
  • $\begingroup$ Also with some fiddling it seems that VertexColors->Hue/@(Rescale@back)yield a more meaningful picture. $\endgroup$
    – LLlAMnYP
    Apr 27, 2015 at 13:27
2
$\begingroup$

After version 10.2, we can directly plot it:

ListDensityPlot3D[data, Boxed -> False, AxesOrigin -> {0, 0, 0}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.