Hi,
Thank you for the reply guys.
1)The first question I want to find a function similar to glTexImage2D in osg.
Here is some code regarding this,
[code]
/* Create checkerboard texture */
#define checkImageWidth 64
#define checkImageHeight 64
static GLubyte checkImage[checkImageHeight][checkImageWidth][4];
static GLuint texName;
void makeCheckImage(void)
{
int i, j, c;
for (i = 0; i < checkImageHeight; i++) {
for (j = 0; j < checkImageWidth; j++) {
c = ((((i&0x8)==0)^((j&0x8))==0))*255;
checkImage[i][j][0] = (GLubyte) c;
checkImage[i][j][1] = (GLubyte) c;
checkImage[i][j][2] = (GLubyte) c;
checkImage[i][j][3] = (GLubyte) 255;
}
}
}
Then setting it
osg::ref_ptr<osg::Image> image=new osg::Image;
image->setImage(64,64,1,4,GL_RGBA,GL_UNSIGNED_BYTE,(unsigned
char*)checkImage,osg::Image::USE_NEW_DELETE);
[\code]
Please do corrections to my code wherever required.
2)Considering second question I want to find texture coordinate of a particular
point on the model.Using picking I can find the 3d position of an
object,Similarly can I get the assigned texture coordinates at an arbitrary
point using osg??This is similar to contactTexCoord(MFVec3f) in H3D.
Thank you!
Cheers,
Tim
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15211#15211
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org