a problem of volume rendering using 3d texture

hello i want to use 3d texture to do volume rendering for example a cube. i read some papers they said that after defining a 3d texture we need to rendering the volume plane which plumb the screen from back to front. now i face the problem of how to make the texture coordinates,some paper said could use multiply matrix to translate the (x,y,z) to (s,t,r) in the " direct volume rendering via 3d textures " but i could not understand the (s,t,r)=TSD-1(x,y,z),because the matrix is 44,but the result is 31,could anyone give me some advice of how to make the texture coordinate in volume rendering using 3d texture? thank you very much!

This demo shows how to generate texture coordinates for volume slices, so that regardless of camera position slices are always view-aligned (perpendicular to the line of sight).


It’s a bit tricky, you have to split modelview matrix into translation and rotations matrix… took me 3 days to understand it:)
Good luck.