Hello Ulrich,
Thanks for the hint. I should have explained a little more.
I am calculating a distance map and want to store it in the 3D texture for
pixel processing.
Which function should i used inside Texture3D to store the 3D data.
Is this data be need to be stored as image. The corresponding OpenGL
command could be as follows:
Code:
glTexImage3D(GL_TEXTURE_3D, 0, 1, width, height, depth, 0, GL_RED,
GL_UNSIGNED_SHORT, final.m_data);
DistanceMap final(width, height, depth, 1);
for (int z = 0; z < depth; z++)
{
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
double value = 0;
for (int i = 0; i < 3; i++)
{
value += dmap(x, y, z, i)*dmap(x, y, z, i);
}
value = sqrt(value)/depth;
if (value > 1.0)
value = 1.0;
final(x, y, z, 0) = value;
}
}
}
I want to achieve the same scenario using OSG. Even if i set the distance map
using the osg::Image, how do i store 3 dimensional data in image using data(int
col,int row) where i need the depth index as well?
Regards
Sajjadul
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=37334#37334
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org