Now, what happens with 3D textures?
As explained, 3D textures are like 2D textures but with an added dimension. So instead of just (S,T) coordinates we have (S,T,R) coordinates. You can imagine such a 3D texture as several 2D textures behind each other. The picture below illustrates this:

Now, instead of looking up texels in a flat image we need to look up a texel in a volume so we need those 3 coordinates S and T (similar to X and Y) and R (which is similar to a depth value, Z). So, do we wrap a 3D object in a 3D texture just like we did with a 2D texture? No, we don’t. We act as if we build our 3D object from a material. Imagine this: a solid block of marble is cut and worked in such a way that we end up with a model of our 3D object. The link between this and 3D volumetric solid textures is easy, the 3 coordinates give an indication of how the 3D object is modeled from the material described in the 3D texture. The 3D texture is a volume and each point inside this volume has a color. By selecting the right points inside this volume you can find the color of the surfaces of the 3D model.
Actually, the link between the 3D model and the 3D texture is quite easy. All you need to do is place the 3D model inside the block of material. A trivial sample is building a block using a 3D texture as material. Actually, the 3D model and the 3D material (the 3D texture map) are identically. So to texture map the block you just select the border pixels from the material. So, the front face just looks identically to the front texture “slice†of the 3D texture. Its quite easy to see the 3D texture as a collection of slices. So a 256x256x256 3D texture can be seen as a group of 256 slices, and each slice can be seen as a simple 2D texture. As I said, a cube would just take as front face the first slice. Now imagine making our block smaller. By doing this we select slices deeper into the material. Of course you don’t need to stay parallel, the lookup system (it’s just math) can link any object position to a position inside the material cube, the 3D texture. Below you can see an example of how a triangle can be linked to a triangle (with (S,T,R) positions) inside the volume:
