Here's how I scale down a texture, in my case it gets applied to a height-field:

        float scale = 0.1;
        osg::TexMat* texmat = new osg::TexMat;
        osg::StateSet* set = meshGeom->getOrCreateStateSet();
        set->setTextureAttributeAndModes(0, texmat, osg::StateAttribute::ON);

Cheers
Mihai

Christian Verbeek wrote:
Hi Ulrich,

Please give me a hint (a line of code) how to set the texture matrix. As
I am new to osg, I would appreciate this a lot.

Regards
Christian

Ulrich Hertlein schrieb:
  
Robert Osfield wrote:
    
On 3/21/07, Christian Verbeek <[EMAIL PROTECTED]> wrote:
      
Dear osg-users,

I want to create a floor textured with a small image being repeated.
Thats what I am doing, but the texture is stretched (i.e shown only
once). What is wrong? I am using the latest OSG version from SVN.
        
ShapeDrawable doesn't support repeating of texture coordinates.  The
closest you could get is to use osg::TexMat, but in the end I think
it'd be easier just to create the geometry yourslef as you need it.
      
To elaborate on that a bit, ShapeDrawable creates texture coordinates
only in the range of 0.0 to 1.0 i.e. the lower-left of the texture in
one corner (of your cube) and the upper-right of the texture in the
opposite corner.

If you place a texture matrix using scale 1000,1000,1 it should look
as you expect.

Cheers,
/ulrich


_______________________________________________
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