[osg-users] adding Texture State

ka Ming ming_ka at yahoo.de
Fri Jul 18 02:08:26 PDT 2008


Hi Robert,
I read in a OSG file. After that I want to add new Textures to Objects. One object can have more than one Texture. If I cannot add a new Texture.
Here is some Code:

osg::Texture2D* osg_texture = new osg::Texture2D;
osg_texture->setImage(tImg);
std::cerr<<"Texture "<<osg_texture->getTextureHeight()<<std::endl; //this is null!! But the Image File isn't null
stateSet->setTextureAttributeAndModes(myTextureNumber, osg_texture, osg::StateAttribute::TEXTURE);

Some Ideas?
Ming 

Hi Ming,

What do you mean by the "image I set is null"?

If you want examples of how textures are set up have a look at the OSG
examples - just do a search for texture2D.  For instance osggeometry
has a textured quad.

Robert.

On Fri, Jul 18, 2008 at 9:43 AM, ka Ming <ming_ka at yahoo.de> wrote:

> Hi,
> I'am trying to add a texture attribute to a existing stateSet. If I try to
> add the attribute with setTextureAttributeAndModes the list size increased
> but the Image I set is null.
> How do I correctly add a texture attribute??
> Thanks
> Ming
>
> ________________________________
> Gesendet von Yahoo! Mail.
> Dem pfiffigeren Posteingang.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>

_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


      __________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080718/5f4151ea/attachment-0003.htm>


More information about the osg-users mailing list