Hi Maria,

When you use eye linear texgen the modelview matrix becomes important,
so to control this properly you have to handle this type of texgen
seperately from normal OSG state.  For positional state (i.e. depends
on the modeview matrix for its final setting) the OSG has a series of
special nodes to help bind a specific location in space with the
position state, the node for TexGen is TexGenNode.  The others are
osg::LightSource and osg::ClipNode.

For examples of how to setup TexGenNode see examples like
osgshadowtexture and osgdepthshadow.

Once everything is set up you may not need to update the TexGen planes
themselves, but if you do all you need to so is the texgen->setPlane()
call, rather than set all the parameters and assign to a StateSet per
frame.

Robert.

On 10/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hi all,
I have a very simple question:

I have this texture attributes being use in some bins:

_texgen2->setMode(osg::TexGen::Mode::EYE_LINEAR);
_texgen2->setPlane(osg::TexGen::Coord::S,osg::Plane(eyeplane[0],eyeplane[1],eyeplane[2],eyeplane[3]));
statesetBin3->setTextureMode(0,GL_TEXTURE_GEN_S,StateAttribute::ON);
statesetBin3->setTextureAttribute(0,_texgen2,osg::StateAttribute::ON);

the "eyeplane" changes depending on the view (When the viewer updates)… Do I
have to repeat this piece of code when I update the view?.... ( If I do.. I
can not the anything)

thanks in advance,

María

_______________________________________________
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