Helper classes for generating geometry?,
Members - Reputation: 689
Posted 05 October 2012 - 05:58 PM
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?