Hi,

I am actually trying to convert an OpenGL model into a .osg one.

The following is a code snippet from my opengl code where I am creating the texture.

 glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
        glBindTexture(GL_TEXTURE_2D, textureArray[textureID]);
        gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pBitmap->sizeX, pBitmap->sizeY, GL_RGB, GL_UNSIGNED_BYTE, pBitmap->data);
    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

Correspondingly ..
in OSG code I set the Texture2D* texture properties as above and setWrap(......REPEAT) as suggested earliear.I also do a setNumMipmapLevels(3) for the gluBuild2DMipmaps above.

Lines from the .osg file

          wrap_s REPEAT
          wrap_t REPEAT
          wrap_r REPEAT
          min_filter LINEAR_MIPMAP_LINEAR
          mag_filter LINEAR


The Required.jpeg shows the one in OpenGL screen and Obtained.jpeg the same portion of the model in osgviewer. The texture coordinates information seems to be correct.
Kindly help.
Thank you,
Kritika Tandon.

On 6/6/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
On 6/6/06, Kritika Tandon <[EMAIL PROTECTED]> wrote:
> Thanks .. !!!
>  There is yet another problem.The texture is getting repeated a lot more
> than is required . The two screen shots are attached what is required and
> what is obtained after using the commands given below.I also tried setting
>  exture->setWrap(osg::Texture2

Your texture coordinates control how often the texture is repeated,
since I don't know how you'v  e assigned the coordinates I can't say
the most efficient route for setting it correctly.  In general I'd say
fix it at source i.e. in your modeller.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to