PDA

View Full Version : Hex Geometry



Foen
November 17th, 2009, 21:53
The new hex map functionality is great, and very welcome. However, I have noticed that vector measurements drawn using pointers work in some directions, but are inaccurate in others (see screenshots).

Although I'm no mathematician, I believe that hexes don't render pixel-perfect, so that is why this might happen. It would be good to know what approximation is used to render the hexes, as it might be possible to 'tweak' the vector calculations to show the right results.

Cheers

Foen

unerwünscht
November 17th, 2009, 22:29
Out of curiosity have you tried other sizes? I have done this a few times now as a test, and it seams that this happens on some sizes but not others. Have not figured out any process for accurately determining the outcome yet. At first I thought it was even sizes worked correctly odd sizes did not, but I no longer think that is the case.

Foen
November 17th, 2009, 22:54
Hmm, I've looked into this in a bit more detail. I don't think this is fixable without a change to the FG engine because the onMeasurePointer event is only passed the pixel length of the vector, and not the x and y components.

The hex rendering introduces a difference between the x and y scales, which cannot be corrected without knowing the x and y components.

Oh well, don't say I didn't try...

Stuart

tdewitt274
November 18th, 2009, 03:49
I haven't used the Hex map, so I can't say based on how it's drawn. However, see the attached image. It's slight, but the height is off from center, one pixel on your original attachment image.

This might be the difference between 6 (vertical) vs 5.9 (diagonal).