Tomy
03-28-2005, 01:58 AM
Hi Experts,
I loaded a 3d image into a 3d texture. Using clipping planes, I saw that the cube was hollow from the inside. As if the cube was made of 6 2d textures. I even saw the boarder images from the inside!! :eek: Blending was disabled. It is a cool effect, but its not what I expected! :)
Here is how I attached the 3D texture
glActiveTextureARB(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_3D, TEXTURE_VOL);
glTexImage3D( GL_TEXTURE_3D, 0, GL_Luminance, 256, 256,_Depth, 0, GL_Luminance,
GL_UNSIGNED_BYTE, data);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_Clamp);
glTexParameterf(GL_TEXTURE_3D,GL_TEXTURE_WRAP_T, GL_Clamp);
glTexParameterf(GL_TEXTURE_3D,GL_TEXTURE_WRAP_R, GL_Clamp);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glEnable (GL_TEXTURE_3D);
Thanks :cool:
I loaded a 3d image into a 3d texture. Using clipping planes, I saw that the cube was hollow from the inside. As if the cube was made of 6 2d textures. I even saw the boarder images from the inside!! :eek: Blending was disabled. It is a cool effect, but its not what I expected! :)
Here is how I attached the 3D texture
glActiveTextureARB(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_3D, TEXTURE_VOL);
glTexImage3D( GL_TEXTURE_3D, 0, GL_Luminance, 256, 256,_Depth, 0, GL_Luminance,
GL_UNSIGNED_BYTE, data);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_Clamp);
glTexParameterf(GL_TEXTURE_3D,GL_TEXTURE_WRAP_T, GL_Clamp);
glTexParameterf(GL_TEXTURE_3D,GL_TEXTURE_WRAP_R, GL_Clamp);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glEnable (GL_TEXTURE_3D);
Thanks :cool: