Hi Otto, Texture3D is no different to Texture1D, 2D etc, all just accept an osg::Image which packs the raw byte data. There are also standard Texture methods for setting the filtering and wrapping, for examples of these it best to look at the osgtexture2D example.
As for creating a 3D osg::Image, again this is much the same as a 2D osg::Image, the only difference is the r dimension having a value that isn't 1. The osgvolume example has code that packs an osg::Image so have a look at this. Robert. On Fri, Sep 25, 2009 at 12:48 PM, Otto Cologne <[email protected]> wrote: > Hi, > > ok I give up. After a lot of trying and searching i still fail to create a > simple 3d texture from a raw byte array for example. Could anyone help me > with how to put something like > > > Code: > > glPixelStorei(GL_UNPACK_ALIGNMENT, 1); > glGenTextures(1, &m_GLuint); > glBindTexture(GL_TEXTURE_3D, m_GLuint); > glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); > glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); > glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP); > glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP); > glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP); > > glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, m_columns, m_rows, m_frames, 0, > GL_LUMINANCE, GL_UNSIGNED_BYTE,&m_data); > > > > > into osg code or point me towards some example code. The texture3d example > here doesn't really help. > > Any help would be greatly appreciated. > ... > > Thank you! > > Cheers, > rs > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=17648#17648 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

