Page 1 of 1
Hex Map / Hex Grid demo with source
Posted: Mon Aug 31, 2009 8:28 am
by Spikey
While back I made a simple demo featuring grids with hexagon tiles. I've added a download containing the demo and source for whom is interested, I've heard many people say that they could not figure out how to do hex grids, this is one solution.
Here's a video
http://www.youtube.com/watch?v=hgqclKY4yVo
Download:
http://www.fileden.com/getfile.php?file ... Source.zip
Screenshot:
Re: Hex Map / Hex Grid demo with source
Posted: Mon Aug 31, 2009 7:52 pm
by hurstshifter
Very cool. This makes me think of a fun board game I've played with some friends a few times called Runebound. It uses a hex based grid for the gameboard and now that I think about it, might actually translate very well to a computer game with a nice grid like this one.
Re: Hex Map / Hex Grid demo with source
Posted: Tue Sep 01, 2009 6:15 am
by Pickzell
That's pretty cool. I'll download it later. :)
Re: Hex Map / Hex Grid demo with source
Posted: Tue Sep 01, 2009 1:26 pm
by Bakkon
While I wasn't necessarily looking for a Hex Map, I'm looking to start learning OpenGL soon and this looks extremely well documented. Really like the comment style for each function. Thanks!
Re: Hex Map / Hex Grid demo with source
Posted: Tue Sep 01, 2009 3:30 pm
by Falco Girgis
I haven't had a chance to check it out yet, but it looks really cool. Are you rendering the hexagons as untextured triangle fans?
Re: Hex Map / Hex Grid demo with source
Posted: Tue Sep 01, 2009 6:33 pm
by Spikey
@GyroVorbis
Currently as untextured gl_polygons. Triangle fans would probably be faster, as well as display lists.
Lots of room left for improvement.
Re: Hex Map / Hex Grid demo with source
Posted: Tue Sep 01, 2009 10:41 pm
by zeid
It was my understanding that the quick draw methods from openGL such as triangle fans, quads, polygons, etc. were being depreciated and that...
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, verticies);
glDrawArrays(GL_TRIANGLES,0,numberOfVerticies); //or GLDrawElements
glDisableClientState(GL_VERTEX_ARRAY);
...was the way people are being incited to do things nowadays. (As well as putting all the vertex data onto your graphics card)