first i have an array for my data:
static unsigned short array[24][24][24][3];
then i fill it with some random numbers as colors:
for(int x=0; x<24; x++)
for(int y=0; y<24; y++)
for(int z=0;z<24;z++)
{
array[x][y][z][0] = rand()255;
array[x][y][z][1] = rand()255;
array[x][y][z][2] = rand()255;
}
then i generate it & bind it, set neccessary
parameters, i am not writing it here, cause i think thats not the point of my problem.
after that i use
glTexImage3D for creating it:
glTexImage3D(GL_TEXTURE_3D, 0,GL_RGB8 , 24,24,24,
0,GL_RGB , GL_UNSIGNED_SHORT, &array);
and finnaly map it on to a quad (i mean a rectangle although it is a 3d texture :)