Hi Eric,

On 2/16/07, Eric Sokolowsky <[EMAIL PROTECTED]> wrote:
I know that this thread is quite cold, but I was wondering if it was
ever implemented as a way to use normalized texture coordinates with
non-power-of-two size images. If not, I might want to take a stab at it.

To help this task Iadded the follow method and functionality into osg::TexMat:

       /** Switch on/off the post scaling of the TexMat matrix by the
size of the last applied texture rectangle.
         * Use a TexMat alongside a TextureRectangle with this
scaling applied allows one to treat a TextureRectnagles texture
coordinate
         * range as if it were the usual non dimensional 0.0 to 1.0 range.
         * Note, the TexMat matrix itself is not modified by the post
scaling, its purely an operation passed to OpenGL to do the post
scaling once the
         * the TexMat matrix has been loaded.*/
       void setScaleByTextureRectangleSize(bool flag) {
_scaleByTextureRectangleSize = flag; }

       /** Get whether the post scaling of the TexMat matrix, by the
size of the last applied texture rectangle, is switched on/off.*/
       bool getScaleByTextureRectangleSize() const { return
_scaleByTextureRectangleSize; }


So you need to add a TexMat alongside the texture being applied with
changing sizes, and set it up to automatically scale, and then just
let the classes do their stuff.

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

Reply via email to