Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: RFC: 8-topology system
Home

[Freeciv-Dev] Re: RFC: 8-topology system

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: RFC: 8-topology system
From: Jason Dorje Short <vze2zq63@xxxxxxxxxxx>
Date: Tue, 16 Oct 2001 22:41:00 -0400
Reply-to: jdorje@xxxxxxxxxxxx

"Miguel Farah F." wrote:
> 
>  Jason Dorje Short [16/10/2001 19:23] dijo/said:
> >Raimar Falke wrote:
> >[...]
> >> > - shape: 0 for rectangle; no other valid values yet.
> >>
> >> 1 for a ellipse
> >>
> >> I think that another shape is good. This may be of no real use but it
> >> allows use to test the code. And a non-isometric ellipse has the
> >> semantics of most north <=> y=0. Also such an ellipse will also have
> >> non-real tiles in the rectangular xsize*ysize.
> >
> >Yes, the purpose of the field is to allow other shapes :-).  A hexagon
> >and a triangle were also mentioned (although the triangle has problems
> >if it wraps).  My only worry is that the (width, height) dimensions
> 
> We could implement a diamond (or lozenge? I'm unsure of the right word
> ("rombo" in spanish)) instead of a triangle:
> 
>      rectangle                    diamond
> 
>    #############                     #
>    #############                    ###
>    #############                   #####
>    #############                  #######
>    #############                 #########
>    #############                  #######
>    #############                   #####
>    #############                    ###
>    #############                     #
> 
> 
> This solves the wrapping problem easily.

A diamond is the same as an iso-rectangle.  In fact, the diamond above
is equivalent to a 9x9 iso-rectangle as defined at the start of this
thread.

It can wrap, and it certainly does not solve the wrapping problem easily
because it's non-trivial to figure out the equations.


As a side comment: there are three directions that a hexagon can wrap
in, but only 5 choices for wrapping directions (which is still more than
the 4 allowed by the ns_wrap and ew_wrap variables):

1.  It can not wrap.
2.  It can wrap north-south.
3.  It can wrap northwest-southeast.
4.  It can wrap northeast-southwest.
5.  It can wrap in all three directions.

It would be easy enough to drop one of the diagonal wrapping directions
so that we get back down to 4.

> >[...]
> >> So based on the xsize and ysize an ellipse should look like:
> >>
> >>                               #
> >>                     # # # # # # # # # # #
> >>               # # # # # # # # # # # # # # # # #
> >>             # # # # # # # # # # # # # # # # # # #
> >>           # # # # # # # # # # # # # # # # # # # # #
> >>         # # # # # # # # # # # # # # # # # # # # # # #
> >>       # # # # # # # # # # # # # # # # # # # # # # # # #
> >>       # # # # # # # # # # # # # # # # # # # # # # # # #
> >>       # # # # # # # # # # # # # # # # # # # # # # # # #
> >>     # # # # # # # # # # # # # # # # # # # # # # # # # # #
> >>       # # # # # # # # # # # # # # # # # # # # # # # # #
> >>       # # # # # # # # # # # # # # # # # # # # # # # # #
> >>       # # # # # # # # # # # # # # # # # # # # # # # # #
> >>         # # # # # # # # # # # # # # # # # # # # # # #
> >>           # # # # # # # # # # # # # # # # # # # # #
> >>             # # # # # # # # # # # # # # # # # # #
> >>               # # # # # # # # # # # # # # # # #
> >>                     # # # # # # # # # # #
> >>                               #
> >>
> >> For testing such shape may also omit wrapping.
> 
> If I may ask, how would an ellipse be defined? I.e., where would both
> focal points be defined?

You don't need to worry about the focal points if you treat it as a
scaled circle, i.e.

x^2 + y^2 <= 1

but moved and scaled so you have

(x-a)^2/a^2 + (y-b)^2/b^2 <= 1

jason


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