I am currently working on a small project to have some fun. This is a C ++ WinAPI application using OpenGL.
I hope this turns into an RTS game played on a grid with a hexagon, and when I get the main game engine, I have plans for further expansion.
Currently, my application consists of VBO, which contains information about vertices and heights. A height map is created using the midpoint shift algorithm (diamond square).
To implement a hexagonal grid, I went with the idea described here here . It shifts the odd rows of the normal grid to provide relatively easy visualization of the hexagons without any additional complications (hopefully).
After a few days, it starts to come together, and I added a mouse pick, which is implemented by rendering each hex in the grid in a unique color, and then fetching that mouse position in this FBO to identify the identifier of the selected cell (displayed in the upper right corner of the screen shot below) .

In the next phase of my project, I would like to look at creating more “reproducible” landscapes. For me, this means that the shape of each hexagon should be more regular than the shape shown in the image above.
So, finally, having come to the conclusion, is there:
- A way to smooth or adjust the vertices in my current method, which would bring the whole point of the hexagon to one plane (coplanar).
EDIT: For anyone looking for information on how to make coplanar points, this is a great explanation .
- The best approach to procedural landscape generation, which would allow for better control over such things.
- The way I present information about my top is different, which allows it.
To be clear, I am not trying to reach a flat hex grid with raised edges or platforms (as shown below).
)
I would like all the geometry to join and enter the next bit.
I hope to get something similar to what I have (relatively beautiful hilly hills and terrain), but with more controlled plateaus. This gives me the flexibility of adding areas (non-playable tiles) later, where I can add more detailed grids if necessary.
Any feedback is welcome, I use this as a training exercise, so please, all comments are welcome!