From: <wak...@ea...> - 2005-07-28 11:50:42
|
I'm working on the placement of E-W oriented hexes and having the damnedest time shifting them left and right. Here's how the math looks: On a Hexagon with each side's length as 1 unit: The vertical distance between the top-most vertex and its neighbor is 1/2. The horizontal distance between the top-most vertex and its neighbor is SQRT(3)/2. So, on the map board, every other row of hexes needs to be offset SQRT(3)/2 units on the X axis. The problem: The code in GUIHex is setting the center of each hex as a java.awt.Point. Point's constructor only allows for an integer-based coordinate assignment. So, by the look of it, this hex code won't support E-W oriented hexes. Does anyone have any ideas or suggestions on how to fix this? ---Brett. |