Sign in to follow this  

Helper classes for generating geometry?

This topic is 1929 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I wanted to explore procedurally generating geometry for various things like buildings, weapons, spaceships, trees, etc... And realized I was rather ill-equipt to do so. So I was wondering if anyone had created some programming tools, or written about the issues involved.

Each one of those things are have some structure that then gets turned into a collection of vertices and indices. I'm not concered with generating the structure yet. (For example the floor plan of a building, or the branch structure of a tree.) That is a whole other problem. But rather how you turn those structures into an actual mesh.

My other experiences with generating geometry (such as height field terrain, marching cubes, and minecraft like voxels) have shown me its rather "messy" working with vertices and indices. I was very prone to screw ups and I had lots to worry about. Such as when you create vertices you need to worry about normals and texture coordinates. And when you create faces you need to worry about order/back facing.

Are there useful algorithms/tools to do things like make sure my texture coordinates are contiguous over a surface. Combine duplicate vertices? Stitch meshes together? Would I be better trying to do these things as I added/created vertices? Or as a "post-process" over the mesh? Or am I just going to have to deal with the "messyness" of it all?

Bottom line: I'd like to make some sort of MeshBuilder class that would make it easier to express the vertice/indice side of things so I can focus more on the aforementioned "structure". But I'm not sure where to go with it other than a list of vertices and faces, has anyone created something like this before?

Share this post

Link to post
Share on other sites
Sign in to follow this