For solution #1, just create a single image file containing both textures,
then go back into your modeling software and set the texture coordinates so
that they index into the appropriate portion of the new combined image. You
might also take a look at the osgUtil::Optimizer, which has an option to
create a texture atlas.
 
For solution #2, you should have a single osg::Geode with two osg::Geometry
objects added to it. The two Geometry objects can share the same vertex
array, if that makes things easier. Each Geometry has its own StateSet, so
each can have its own texture.
 
I hope that helps.
   -Paul
 


  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Aitor
Arrieta
Sent: Thursday, October 09, 2008 9:57 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Using different textures for the same geometry


Hi all

First of all, this is my first time writing here so sorry if I do something
wrong...

Here is my question. I have an obj file, which I have exported from Poser. I
have modified this file in order to have only one geometry, that is, there
is only one osg::node. This new file works fine in my application and I can
see the figure with no problems. However, the problem comes when I try to
apply the original textures to this figure, because I have more than one
image files for the single osg::Node.

As far as I know, there could be two different solutions for this problem:

1- Create a single texture combining all the textures I have and then apply
it to the node
2- Apply a different texture to each vertex group

For the first one, I have googled for some days and I am not able to find a
program which can do it.
For the second one, I know which vertex should be with any of the different
textures, but I do not know the way to do it from c++ using the osg
libraries.

Can anyone please help me? I know that my explanation was not very good so
if you need further information just ask for it.

Thank you very much in advance.

Regards,

Aitor


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

Reply via email to