Article View: rec.games.programmer
Article #160looking for hexagon-related algorithms
From: Nicolai Czempin
Date: Thu, 23 Jul 1992 17:00
Date: Thu, 23 Jul 1992 17:00
22 lines
1333 bytes
1333 bytes
In some board games (especially wargames), movement and position of pieces is regulated by hexagons. In some wargames, there is a thing called LOS (Line of Sight). This is used to determine if some unit can "see" another, or if its LOS is "blocked". To find out, you draw a (n imaginary) line from one hex center to the other. If any hexes that line crosses are defined as "blocking", then the LOS is blocked. When using squares, it is simply an adaption of a line-drawing algorithm. I could put lots of effort into working this out, but I tend to dislike rein- venting the wheel. So, if anybody has got an algorithm for checking LOS, please let me know. If you have any hints that would make finding one myself easier, go ahead. Thanks, Nicolai -- Nicolai Czempin, University of Karlsruhe, Germany "I am not left-handed either"
Technical Details
Message-ID:
<14moihINNl11@iraul1.ira.uka.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!uka!uka!newsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!uka!uka!news From: S_CZEMPIN@iravcl.ira.uka.de (Nicolai Czempin) Newsgroups: rec.games.programmer Subject: looking for hexagon-related algorithms Date: 23 Jul 1992 17:00:01 GMT Organization: University of Karlsruhe (FRG) - Informatik Rechnerabt. Lines: 22 Distribution: world Message-ID: <14moihINNl11@iraul1.ira.uka.de> NNTP-Posting-Host: irav1.ira.uka.de X-News-Reader: VMS NEWS 1.23