Hi Vincent,

osg::TextureCubeMap does work just fine, the osgvertexprogram,
osgprerendercubemap and osgdistortion examples illustrate this.  As to
what is up with your problem I can't say.  The best I can recommend is
go search OpenGL docs on texture cube maps so you understand how they
work then the OSG constructs will make more sense.

Robert.

On Tue, May 6, 2008 at 3:49 PM, Vincent Bourdier
<[EMAIL PROTECTED]> wrote:
> Hi robert,
>
> Thanks for this answer, I'll try later and look on other way...
>
> Just a last question to be sure :
>
> I just want to put a texture depending on face (and not on geometry) (6 face
> for cube or similar objects for example)... TextureCubeMap doesn't work, so
> have you any idea (with OSG or OpenGl) on how to do something similar ?
>
> thanks a lot,
>
> Regards,
>    Vincent
>
> 2008/5/6 Robert Osfield <[EMAIL PROTECTED]>:
>
>
> > Hi Vincent,
> >
> > I'm not sure how other people could help you here - its very much a
> > question that doesn't have enough information about the problem to
> > know what an appropriate answer might be.
> >
> > Texture coordinate generation in OpenGL is an awkward topic, and the
> > best I can recommend is that you dive into books or online texts that
> > discuss it.  The OSG for the most part basically just does a direct
> > pass through of settings you make on OSG objects when pass the values
> > to OpenGL so OpenGL docs should serve you well.
> >
> > Robert.
> >
> >
> >
> >
> > On Tue, Apr 29, 2008 at 9:51 AM, Vincent Bourdier
> > <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > With some new tests, I've something different as you can see in the
> attached
> > > file
> > >
> > > I use this code
> > >
> > > >
> > > > osg::TextureCubeMap* texcube = new osg::TextureCubeMap();
> > > >
> > > >     osg::Image* white = createWhiteImage(_x,_y);
> > > >
> > > >     texcube->setImage(osg::TextureCubeMap::POSITIVE_X, white);
> > > >     texcube->setImage(osg::TextureCubeMap::NEGATIVE_X, white);
> > > >     texcube->setImage(osg::TextureCubeMap::POSITIVE_Y, white);
> > > >     texcube->setImage(osg::TextureCubeMap::NEGATIVE_Y, white);
> > > >
> > > >     texcube->setImage(osg::TextureCubeMap::POSITIVE_Z,
> _texGrad.get());
> > > >     texcube->setImage(osg::TextureCubeMap::NEGATIVE_Z, white);
> > > >
> > > >  osg::TexGen *tg = new osg::TexGen;
> > > >  tg->setMode(osg::TexGen::OBJECT_LINEAR);
> > > >
> > > > geode->getOrCreateStateSet()->setTextureAttributeAndModes(0, tg,
> > > osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
> > > >
> > > >
> > > > geode->getOrCreateStateSet()->setTextureAttributeAndModes(0, texcube,
> > > osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
> > > >
> > >
> > > Any idea of how to obtain a good mapping ?
> > >
> > > In the picture we can see 6 face or the TextureCubeMap, but how to put
> it a
> > > the good size ?
> > >  Have you already used TextureCubeMap ? or how can you did the mapping
> on a
> > > "face" of a geode ?
> > >
> > > Thanks a lot,
> > >
> > > Regard.
> > >    Vincent.
> > >
> > > 2008/4/25 Vincent Bourdier <[EMAIL PROTECTED]>:
> > >
> > >
> > >
> > > > Hi all,
> > > >
> > > > Attempting to put a texture on a geode, (a texture computed in real
> time)
> > > I've used osg::TextureCubeMap, which look good to do this with my
> data...
> > > but I have problems with the correct mapping:
> > > >
> > > > In the attached file you can see
> > > > 1. the texture
> > > > 2. the node with this texture
> > > >
> > > > As you can see, it looks like nothing ...
> > > >
> > > > I use this code to obtain this result :
> > > >
> > > >
> > > >
> > > > >     osg::TextureCubeMap* texcube = new osg::TextureCubeMap();
> > > > >     texcube->setImage(osg::TextureCubeMap::POSITIVE_X,
> _texGrad.get());
> > > > >     texcube->setImage(osg::TextureCubeMap::NEGATIVE_X,
> _texGrad.get());
> > > > >     texcube->setImage(osg::TextureCubeMap::POSITIVE_Y,
> _texGrad.get());
> > > > >     texcube->setImage(osg::TextureCubeMap::NEGATIVE_Y,
> _texGrad.get());
> > > > >     texcube->setImage(osg::TextureCubeMap::POSITIVE_Z,
> _texGrad.get());
> > > > >     texcube->setImage(osg::TextureCubeMap::NEGATIVE_Z,
> _texGrad.get());
> > > > >
> > > > >
> > > > >     osg::TexMat* texmat = new osg::TexMat;
> > > > >     texmat->setScaleByTextureRectangleSize(true);
> > > > >     geode->getOrCreateStateSet()->setTextureAttributeAndModes(0,
> texmat,
> > > osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
> > > > >
> > > > >     geode->getOrCreateStateSet()->setTextureAttributeAndModes(0,
> > > texcube, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
> > > > >
> > > >
> > > > Wrapping seems to do nothing... TextureRectangle depends of the
> geometry
> > > vertices ans edges...
> > > >
> > > > If you have any idea, I'll be happy to hear you.
> > > >
> > > > Thanks.
> > > >
> > > > Regards,
> > > >    Vincent.
> > > >
> > >
> > >
> > > _______________________________________________
> > >  osg-users mailing list
> > >  osg-users@lists.openscenegraph.org
> > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > >
> > >
> > _______________________________________________
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
>
>
> _______________________________________________
>  osg-users mailing list
>  osg-users@lists.openscenegraph.org
>  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to