Hex Map / Hex Grid demo with source

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Post Reply
User avatar
Spikey
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 98
Joined: Sat Dec 13, 2008 6:39 am
Programming Language of Choice: C++
Location: Ottawa, Canada
Contact:

Hex Map / Hex Grid demo with source

Post 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:
Image

:cheers:
User avatar
hurstshifter
ES Beta Backer
ES Beta Backer
Posts: 713
Joined: Mon Jun 08, 2009 8:33 pm
Favorite Gaming Platforms: SNES
Programming Language of Choice: C/++
Location: Boston, MA
Contact:

Re: Hex Map / Hex Grid demo with source

Post 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.
"Time is an illusion. Lunchtime, doubly so."
http://www.thenerdnight.com
User avatar
Pickzell
Chaos Rift Junior
Chaos Rift Junior
Posts: 233
Joined: Sat May 16, 2009 10:21 am

Re: Hex Map / Hex Grid demo with source

Post by Pickzell »

That's pretty cool. I'll download it later. :)
I'm an altogether bad-natured Cupid.
User avatar
Bakkon
Chaos Rift Junior
Chaos Rift Junior
Posts: 384
Joined: Wed May 20, 2009 2:38 pm
Programming Language of Choice: C++
Location: Indiana

Re: Hex Map / Hex Grid demo with source

Post 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!
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Hex Map / Hex Grid demo with source

Post 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?
User avatar
Spikey
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 98
Joined: Sat Dec 13, 2008 6:39 am
Programming Language of Choice: C++
Location: Ottawa, Canada
Contact:

Re: Hex Map / Hex Grid demo with source

Post 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.
User avatar
zeid
Chaos Rift Junior
Chaos Rift Junior
Posts: 201
Joined: Fri Apr 24, 2009 11:58 pm

Re: Hex Map / Hex Grid demo with source

Post 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)
Axolotl Pop!
Image
Or, try it for free.

For many more free games online visit www.sam-zeid.com
Post Reply