From: <wak...@ea...> - 2005-07-28 11:55:11
|
AH HA. Nevermind. I found java.awt.geom.Point2D.Double. It's almost 5am. I'm a bit tired. :-) ---Brett. -----Original Message----- From: wak...@ea... Sent: Jul 28, 2005 4:50 AM To: rai...@li... Subject: [Rails-devel] Critical problem with Hex code 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. ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Rails-devel mailing list Rai...@li... https://lists.sourceforge.net/lists/listinfo/rails-devel |