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
http://atitech.ca/developer/sdk/RadeonSDK/Html/Samples/OpenGL/RadeonVolVis.html


glBindTexture(GL_TEXTURE_3D_EXT,names[0]); 
  glTexParameteri(GL_TEXTURE_3D_EXT,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE_EXT);    
glTexParameteri(GL_TEXTURE_3D_EXT,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE_EXT);    
glTexParameteri(GL_TEXTURE_3D_EXT,GL_TEXTURE_WRAP_R_EXT,GL_CLAMP_TO_EDGE_EXT);    
glTexParameteri(GL_TEXTURE_3D_EXT,GL_TEXTURE_MAG_FILTER,GL_LINEAR);    
glTexParameteri(GL_TEXTURE_3D_EXT,GL_TEXTURE_MIN_FILTER,GL_LINEAR);    
glTexImage3DEXT(GL_TEXTURE_3D_EXT,0,GL_ALPHA8,tWidth,tHeight,tDepth,0,GL_ALPHA,
                    GL_UNSIGNED_BYTE,image1);

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

greetings,
lobbel

Hi,

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):
http://www.vrvis.at/via/resources/course-volgraphics-2004/

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.

greetings,
lobbel

I’m also interested in generating these perpendicular slices.

Can anyone offer some insight on this?

EDIT:

The answers lie with the glTexGen command, i think.