egg file and Geom

I wonder whether it’s possible to add some entry in the egg file so that different sets of GeomVertexData would be generated for different groups? In other words, the GeomNode from the egg file should contain more than 1 Geom whose GeomVertexData should not be shared. I tried to add the tag in the egg file but it doesn’t work. I can generate 2 different Geoms by using different rendering states but the GeomVertexData is still shared. My objective is to separate different convex sets of vertex for collision purpose. I guess the best way is to do a custom parsing of the egg file if this doesn’t work.

You can add a name to each polygon, like this:

<Polygon> name1 { ... }
<Polygon> name2 { ... }

All the polygons within a that have the same name will be assigned to a GeomNode of that name. This is mainly used by the egg-optchar -flag option, which is useful to separate out geometry in an animated model that would otherwise be collapsed into a single node.

For a non-animated character, though, simply grouping the polygons into a different is usually sufficient to separate out the pieces into different GeomNodes.

There’s no way to put them all in the same GeomNode and still have separate GeomVertexDatas, but I don’t know why that would be useful. If you want them separated, you might as well have them in separate nodes too.

Of course, for collision purposes, it’s best to use collision geometry anyway, not GeomNodes, assuming you’re talking about Panda’s built-in collision system.

David

Thank you I get it working now.