Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#3936) introducing native coordinates
Home

[Freeciv-Dev] Re: (PR#3936) introducing native coordinates

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>, jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3936) introducing native coordinates
From: Ross Wetmore <rwetmore@xxxxxxxxxxxx>
Date: Sun, 27 Apr 2003 15:43:44 -0400


This is another way to generate a compact pattern aligned with the target
axes. It is basically a flavour of the first case but presented as a
slightly different set of just two cuts.

To generate the first case this way, one takes slightly less than a full
side width, and then does fixup cuts to fill in the residual triangular
holes.

The 4th bitmap shows how the "L" shaped normal sets wrap in one
dimension. The solid colour region is an "N" shape that shows how an
"L" becomes an "N", then back to an inverted "L", then inverted "N"
and finally an "L" as the origin point of the leading edge is changed.

The fact that a rectangular normal set produces an "L" or "N" shaped
normal set in a compact pi/4 rotated view is a result of the differing
lengths of the sides of the rectangle. A square map would produce a
pure diamond (aka rotated square in the target view).

Cheers,
RossW
=====

Ross Wetmore wrote:

As a primer ...

[...]

Personally, I found it instructive to understand the process here visually, and thus drawing graphs and doing a geometric mapping operation on paper helped me to verify all the subtleties of the code conditions. The comments tell you how to do this and the result to look for in the simple 1-D wrapping case (the normal set rectangle gets mapped to a parallelogram to remain within the positive
region of the target axes) as well as the full 2-D one.

Geometrically, every point (above/)below a diagonal line through the origin is wrapped to the other end of the rectangle to create a parellelogram in the simple case. Points below that diagonal line would be negative in the output coordinate system. This is a vector operation (bounded by a diagonal line) rather than a simple single coordinate "+ map.xsize" operation because the transformation is a linear combination of coordinates rather than an independent function of each
coordinate separately as in the parellel wrap axes case.

For the 2-D case you just need to juggle more mental balls because you wrap in
two diagonal/vector steps, but the logic is the same.

[...]

Windows bitmap

Windows bitmap


[Prev in Thread] Current Thread [Next in Thread]