View Full Version : 2D & 3D Texture Coordinate System

03-30-2005, 03:08 AM

I use 2D and 3D(ATI RADEON 9200) textures, and I noticed a difference between the 2D & 3D coordinate system of the arrays and the textures ?

For 2D: Tab[line][row] from top left gives a Tex[t][s] from bottom left.

For 3D: Tab[Depth][line][row] gives an identical texture coordinate system Tex[t][s][r].

Is it correct ? Did I something wrong which gave me this result ? Does it depends of the used graphical card and particular extension ?

Thanks in advance for your help and your time.

03-30-2005, 10:14 AM
This is only partly correct if I understand your notation.

It seems you are using multi-dimensional array notation to indicate which axes of data is major vs minor.

Therefore a 2D and 3D image would be correctly declared as:

pixel_type image_array_2D[t_height][s_width]

pixel_type image_array_3D[r_depth][t_height][s_width]

This means that a 3D image is depth major and therefore is comprised of a series of 2D images stored contiguously and sequentially in memory.

When specifying texture coordinates you will specify s,t,r in that order, where when *clamped* the coordinate 0,0,0, will produce the color of the first pixel in the 3D array.

03-30-2005, 09:20 PM
Thanks a lot, I had not seen the problem as a memory management problem. It is clear.