Actually i think we should define what you mean for automatically.
Because if you mean like a generateIndexes(mesh) method, that works for every mesh, this is not possible.
If you want to fill a 2d shape of which you have only the external edges, this is possible, search for triangulation algorithms.
If you know the order of your vertices, ie. you generated them from a known function, then you can calculate the index as well… you just need to join the points… for instance in your specific case (first screenshot), you can find the central vertex, and then join any group of two adjacent vertices with the central one.
BTW why do you want to do this?
Is it just to have more vertices (for eg. Lighting or a terrain) or do you have some special plan for it like a triangle based strategy map, because then you should use different meshes instead of one
I am not going to make exactly “flat terrain system” but as of now in its initial stage it will be flat terrain only.
My Idea for Hex terrain system is like below.
Hex terrain will have many hex tiles.
The tiles can be added and removed or hide as per users preference. Idea is at a time 7 tiles will be on screen.
Each tile will have reference of its neighbors.
Each tile will have logical hex grid. The logical grid is basically virtually divided area of surface.
The logical grid will keep track of any assets on surface. e.g. trees grass, water, surface type, weather, characters and part of story line.
Event listeners and notification system will be implemented on tile and its logical grid.
Tile will be relatively small so that more better graphics can be presented.