# Make continuous 3D tube out of 2D image (Mathematica 8) [duplicate]

I have the following image with transparency:

which I want to paste repeatedly into a 3D space to make it like a tube, something like this (but denser):

I tried using the code from here but it tells me that "Image is not a Graphics3D primitive or directive", and although the code from the question works, it has the same problem as in the question, it is not transparent.

So what should I use to make the transparency render? Or is there a better approach to my problem?

This is the slightly edited code I used:

g = Import["C:\Users\Eric\Desktop\Tube.png"];
Graphics3D[
Table[{{Texture[g],
Polygon[{{0, 0, z}, {0, 1, z}, {1, 1, z}, {1, 0, z}},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0,
1}}]}}, {z, 0, 1, 1/3}], Lighting -> {{"Ambient", White}},
ViewPoint -> {1, 4, 7}]


Edit: I need this to work on 8.0, although Image3D works it is not implemented there, what can I do then?

• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. Apr 12, 2015 at 18:54
• Your question is unclear. What do you mean "paste repeatedly into a 3D space to make it like a tube"? Edit your question to include the code that you have written, even though it does not fully meet your need. Apr 12, 2015 at 18:58
• @bbgodfrey Done. Apr 12, 2015 at 19:16
• It would be a good idea to include the Tube.png image in the question Apr 12, 2015 at 19:17
• @SimonWoods Thanks for the suggestion, also done! Apr 12, 2015 at 19:20

A simple approach:

i = Import["http://i.stack.imgur.com/Jzimv.png"];
i = ImageResize[i, 200];

Image3D[Table[i, {200}]]


If it's just for display, there is no need to create multiple copies of the image - just make a 3D image one pixel deep and use BoxRatios to stretch it vertically:

Image3D[{i}, BoxRatios -> {1, 1, 1}]

• Thanks! I think it works, but sadly I am stuck in 8.0 and Image3D was introduced in 9.0. Is there a similar function I can use? Apr 12, 2015 at 20:18
• @AnonymousPi, AFAIK there is nothing similar to Image3D in version 8, so you will need to use Graphics3D in some way. I suggest you edit the question to state that you need a version 8 solution, and unaccept this answer (questions without an accepted answer tend to get more views) Apr 13, 2015 at 17:32