Hi Frank,

I am just trying to implement some sliding textures for things like waterfalls 
and what have you. I figure that the best way to do this is to modify the 
texture matrix.

Yes, you've got the theory right, let's see about the practice:

  // ...
stateSet->setTextureAttribute(0, textureMatrixAttribute.get(), 
osg::StateAttribute::OVERRIDE);

You need osg::StateAttribute::ON at least (and you can or-that with OVERRIDE if you want) for the attribute to take effect. Just OVERRIDE doesn't include ON, so it's equivalent to OFF | OVERRIDE which isn't what you want obviously...

stateSet->setTextureMode(0, GL_TEXTURE_MATRIX, osg::StateAttribute::ON);

You shouldn't need that, the osg::TexMat should turn this on when it gets applied. But it doesn't hurt.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to