PDA

View Full Version : Generating 2D textures from a 3D matrix (against the grain)



PeterK
10-30-2000, 05:15 PM
I have a 3D matrix of bytes, (ImageSeries[512][512][70], where each 512x512 "slice" of data ImageSeries[x][y] to ImageSeries[x+1][y]),is an image that I use to create a texture map.

My question: how can I generate 2D texture maps from slices of the 3D matrix data are in (for example) the y-z plane, having data scattered through out the matrix?

I am hoping that I won't have to reorder the data into nice contiguous chunks.

Is there any way to get glTexImage2D to skip a number of bytes between consecutive data bytes (i.e. give it a stride similar to that of vertex arrays)?