Home » Community » Forums » » Coordinates in Hexagon-Based Tile Maps
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 Coordinates in Hexagon-Based Tile Maps
Post Reply 
Âîáùåì àõóåííåéøàÿ ñòàòüÿ.

 User Rating: 1015    Report this Post to a Moderator | Link

There is an error in this article. The B-section right top should not subtract one from the x coordinate.

//pseudo Code!!!
// right side
if SectPxlX  >= HexagonR then begin
  if sectPxlY < (2 * HexagonH - SectPxlX * m) then begin
    ArrayY := SectY - 1;
    // ArrayX := SectX - 1; <-- Remove this line
  end else begin
    ArrayY := SectY;
    ArrayX := SectX;
  end;
end;
// left side
...



 User Rating: 1163   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

Is it me or is the calculation for the values r and h the wrong way round. Consider a hex of side 100, h would evaluate to 15.x and r 98.x. r is clearly the longer distance - is it a simple typo or have I been looking at it too long ?





 User Rating: 1023   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link


In the pseud-code:

PixelX := ArrayX * 2 * TileR + (FieldX AND 1) * TileR



What fieldX means? Shouldn't it be ArrayX? :S

[]s

Túlio Caraciolo

 User Rating: 1025   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: