Newsgroups: comp.ai.games
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!news.mathworks.com!news.kei.com!news.texas.net!news.frontiernet.net!newstest.eznet.net!NEWS2!not-for-mail
From: burg@eznet.net (Iceburg)
Subject: hex maps and line of sight
Message-ID: <5c7cc$111619.372@NEWS2>
Date: Sun, 12 May 1996 20:24:11 GMT
Organization: Scurvy Inc.
Reply-To: burg@eznet.net
X-Newsreader: Forte Free Agent 1.0.82
Lines: 26

Hello

I was wondering if someone could help me out. I'm trying to figure out
how to figure Line of Sight in a hex map. I've been able to figure out
how to find the range from point one to point two, but I need to be
able to find exactly which hexes a line of sight would go through.

Also, what's the best way to figure out coordinates on a hex grid, the
way I have it now is the horizontal lines zig-zagging up and down
while the vertical lines are straight. With this way, I've noticed
it's very important to know wether the current x location is even or
odd.  Another way I've seen it done (on board games) is to have the
vertical lines be vertical, but to tilt the horizontal lines so
they're actually going straight though lines of hexes at a 60 degree
angle, but to do this in a computer game seems like it would waste
tons of memory the bigger the map is because the map would be a
trapazoid rather than a rectangle and the corners would have to be cut
off.

If anyone can lend a hand, or drop a clue, I'd appreciate it. Not
neccessarily programming code, just logic explanations would be fine.

Thanks!!
-Greg



