Hi Paul I don't know if this is a stupid question or not but I'm already going crazy...
I can't use your code because I don't create new geometries. Instead of this, I get an osg::geode from an obj file. At this moment, I can only get a single geometry from the geode and apply a single texture to it. But this is not what I want. The obj file represents a human figure, and I would like to separate the head from the body because they have different textures. I know which vertices are from the head and which ones for the body so this won't be a problem in this case. The problem is that they must share the same vertex array, which is used to do some morph tasks. My question is, how can I create two different geometries starting from the same geode and sharing the same vertex array? Is this possible or not? Thanks a lot Paul and sorry for the inconveniences Regards, Aitor ----- Mensaje original ---- De: Paul Martz <[EMAIL PROTECTED]> Para: OpenSceneGraph Users <[email protected]> Enviado: martes, 14 de octubre, 2008 17:38:17 Asunto: Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes The code I posted will work for the use case you describe. Indices are part of the PrimitiveSet; assign a different PrimitiveSet (with different indices) to each Geometry and they will index into the same vertex array. -Paul ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aitor Arrieta Sent: Tuesday, October 14, 2008 9:05 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes Hi Paul Thanks a lot for your reply, but unfortunately I think that my question is not as simple as you think. Sorry because it was my fault as I did not explain myself correctly. The problem is that I must have a single vertex arrays for many different geometries but each geometry uses only a part of this vertex array.. That is, imagine a single vertex array with indices from 1 to 100. I should have geometry 1 with indices from 1 to 10, geometry 2 with indices from 11 to 20, etc. But all of them sharing the same vertex array, which is used to do some other things. Sorry for my bad explanation and thanks again for your reply. Best regards, Aitor ----- Mensaje original ---- De: Paul Martz <[EMAIL PROTECTED]> Para: OpenSceneGraph Users <[email protected]> Enviado: martes, 14 de octubre, 2008 16:54:00 Asunto: Re: [osg-users] Sharing Vertex Arrays between Geometry Nodes osg::Geometry* geom0 = new osg::Geometry; osg::Geometry* geom1 = new osg::Geometry; osg::Vec3Array* verts = osg::Vec3Array; geom0->setVertexArray( verts ); geom1->setVertexArray( verts ); Hope that helps. -Paul ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aitor Arrieta Sent: Tuesday, October 14, 2008 8:39 AM To: [email protected] Subject: [osg-users] Sharing Vertex Arrays between Geometry Nodes Hi all, I am developing an application in which I have to share the same vertex array between different nodes in order to apply a different texture to each of them. I know that this is possible to do because I have read it. However, I am a beginner in the osg world and I am not able to find the way to do it. Someone told me that I could use the same geode having different geometries but how can I specify a vertex array for a geode? As far as I know this is impossible, is not it? I have also read something about using the DrawElementsUShort primitive but how should I use it? My question is: is there any example of sharing vertex arrays between geometry nodes anywhere? Or has anybody done this before? In short, could anybody please help me with this task? Thank you very much in advance. Regards, Aitor
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

