3D Textures and automatic texture coordinate gener

Hello there,
i have programmed a simple volume renderer. At this time
it uses the 2D texture mapping for creating the volume.
Now i want to implement 3D texture mapping. does anyone has experience with it ? I’ve read on the internet some things about
this topic. but it never has been explained in detail how to get the texture’s created out of the volume data and what happens when
the camera rotates. In 2D texture mapping you have to switch the
x y and z axis acoording to the view vector. In 3D texture mapping
you have one 3D texture that builds the model. but it is also said the textured slices will be build perpendicular along the viewvector inside a cube.
Can some one explain it to me , please ?

This is a code snippet from ATI’s example of a very simple
direct volume rendering. You can find the example here


I know I have to load the 3d texture extension. Thats not the question here.



Are you wanting to texture a 3D model, or generate one from a field of some sort?

Lots of interesting ways to generate texture coordinates in 3D. Pretty much any mapping you can imagine is possible now.

Great course on the general subject (and their book is a must have):

Hello thanks for your reply. I’ve already seen these papers.
They are about ray casting and other iso surface generation
algorithms. In volume rendering with 3D texture you have a single 3d texture that contais all voxel data. Then you have to build slices perpendicular to the view vector. And thats my problem.
I have seen some examples but i yet dont know how to compute the texture coordinates for those slices and so on.
2D texture volume rendering works fine. i have goo results with it. But of course it has disadvantages. i.e when switching between to texture stacks.


I’m also interested in generating these perpendicular slices.

Can anyone offer some insight on this?


The answers lie with the glTexGen command, i think.