Hello,

I'm trying to use projective texture and the dimensions of the texture
I'm using are not a power of 2.

I used the osgDepthShadow example as a starting point and modified it
to use osg::TextureRectangle instead of osg::Texture2D. 

Since texture rectangle uses texture coordinates [0,width] and
[0,height] instead of [0,1] and [0,1], I modified the osg::Matrix MVPT
supplied to TexGen->setPlanesFromMatrix so that it could generate the
proper texture coordinates.

For a 640x480 texture:
osg::Matrix MVPT = _cameraNode->getViewMatrix() * 
                               _cameraNode->getProjectionMatrix() *
                               osg::Matrix::translate(1.0,1.0,1.0) *
                               osg::Matrix::scale(320.0,240.0,0.5);

This has not worked. :(

Has anyone done it before? Any advice is appreciated.

Thanks in advance,
Enylton.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to