I want to combine an Image3D
and a Graphics3D
using Show
. Here is the code:
data = Table[
Abs[((3 - 3 z) (.5 Sign[3 - 3 z] + .5)) (x Sin[x] + y Cos[y])],
{x, 0, 15, .1}, {y, 0, 10, .1}, {z, 0, 3, .1}
];
Show[Image3D[data/Max@data],
Graphics3D[{AbsoluteThickness[5], Blue,
Line[{{0, 0, 0}, {2, 2, 2}, {3, 3, 2}, {8, 5, 2}, {14, 9, 2}, {15,
10, 0}}]}]]
While the coordinates are aligned, the output is not.
See the blue line on the right corner. How can I fix the problem?
Edit:
The issue is resolved. There are two answers below. Both are helpful but neither of them is complete. Once any of them is competed, I'll mark it as accepted. I write one possible answer to the question here (I added {#[[3]], #[[2]], #[[1]]}/delta & /@ pointList
to my code):
With[{delta = .1},
data = Table[
Abs[((3 - 3 z) (.5 Sign[3 - 3 z] + .5)) (x Sin[x] + y Cos[y])],
{x, 0, 15, delta}, {y, 0, 10, delta}, {z, 0, 3, delta}
];
Show[Graphics3D[{AbsoluteThickness[5], Blue,
Line[{#[[3]], #[[2]], #[[1]]}/
delta & /@ {{0, 0, 0}, {2, 2, 2}, {3, 3, 2}, {8, 5, 2}, {14, 9,
2}, {15, 10, 0}}]}], Image3D[data/Max@data]]
]
Raster3D[]
instead... $\endgroup$