Merging vertices

Does Panda3D have any features that might automatically merge nearby vertices in a set of models? (Presumably reducing them to a single model or smaller set of models.) Or would achieving this call for manually creating the geometry in question?

To explain: I’m constructing some basic Wolfenstein-3D-style level-geometry using cards generated by a CardMaker object: each “floor tile” is a card, and walls are cards scaled to the appropriate length and height. For the most part this works, especially after a call to “flattenStrong”.

However, in places one can see single-pixel gaps at the edges of the cards. My thought, then, is to attempt to fix this by making the elements of my geometry share vertices, much as they likely would if the scene had been modelled in a 3D-modelling program.


Ah, I’ve just discovered that my problem lies not with gaps between tiles, but rather with the tiles on the other side of walls sometimes glimmering through at the edges.

A depth-offset and a slight downwards shift of my walls’ positions seems to have solved the problem!

(I’m not convinced that I won’t see real gaps between tiles at some point, so I’m still open to suggestions for that, but otherwise I’m happy to consider this closed!)

For the record, there is no difference in rendering output between having a shared vertex and having two vertices that have the exact same position (at least as far as rasterisation is concerned).

Fair enough–but when the vertices belong to two separate objects, translated and rotated into position, I fear that small variations may result in the vertices have not quite the same positions, thus potentially leading to holes.

However, I’ll worry about that if it actually comes up, I think.

Thank you for the reassurance! :slight_smile: