Rendering terrain

Started by
3 comments, last by cwhite 19 years, 2 months ago
I am making a strategy game based on a hex map. My initial map was a grid of hexes that could be raised, angled, and rotated. This is fairly simple and really ugly. What I would like is a semi-smooth 3d terrain with a hex grid laid on top of that. The hex grid can be a separate entity that gets laid on top of the terrain since it might not always be visible. The easiest thing I can think of is to setup a 2 dimensional array and store color and height data in that and render each of those individual points. So basically a voxel based map. This seems like a bad idea though since I will need roughtly a 64x64 hex map and at least 25x25 pixels per hex to make it look ok, probably more to make it look nicer. Really my main problem is that I am at a loss for search terms. I dont know where to start looking. Does anyone have recommendations as to how best create the terrain or some articles that I could read? -Mikel
Advertisement
1. Are you working in 3D or 2D?
2. Are the hex'es movable positions, like settlers...? What are you using them for?
----------------------------------------------------------------------------------------------------------------------"Ask not what humanity can do for you, ask what you can do for humanity." - By: Richard D. Colbert Jr.
1) Think of each hex as 6 triangles, with a vertex in the center of each hex.
2) Set the center vertex of each hex to the height of that hex.
3) Set the vertex at the edge of a hex to the average of the three hexes that share that vertex.
4) Render as triangle mesh.

To actually draw the hex overlay, I would create a repeating texture with alpha that draws a hex grid, and overlay it on the ground plane using X/Z as texture coordinates (assuming Y is up).
enum Bool { True, False, FileNotFound };
I think I probably asked the wrong question.

(does some more research...)

What I really want is a basic terrain renderer that renders low detail terrain. Then on top of that I need to place a hex grid. The hex grid is game idea only. I should not have any effect on terrain rendering.

What I need is something like this, only take out the triangles and replace them with hexes. I dont need to render the ground with hexes, I just need the player to see hexes.
http://home.planet.nl/~monstrous/image/terr01.jpg

Make sence?
Like hplus said, create a texture map of a hex grid and simply alpha-blend that texture over your entire terrain. The picture you referenced was made by rendering first in fill mode, then second in wireframe mode. That would not make sense for your project, and it would be much easier for you to just create a hex grid texture with alpha values and blend it with your rendered terrain.

This topic is closed to new replies.

Advertisement