Circle generator.

Designed a level that creates new, exciting, and challenging Armagetron game play? Or maybe just something funky. Put it right here.
QUARG
Round Winner
Posts: 223
Joined: Thu Sep 14, 2006 2:38 pm
Location: montreal

Circle generator.

Post by QUARG »

dear god plz tell me somebody has the circle generator for mapping. The link has died.



http://generalconsumption.org/armagetron/

http://wiki.armagetronad.net/index.php? ... _Beginners
User avatar
DDMJ
Reverse Outside Corner Grinder
Posts: 1882
Joined: Thu Jun 08, 2006 12:15 am
Location: LA, CA, USA, NA
Contact:

Post by DDMJ »

User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

Make a circle in Inkscape, save the file as a plain svg, put it through the svg2aamap on that link durka gave.
Remember the top left hand corner of the inkscape page relates to 0,0 on the aamap. Once you've got that, zones and spawns sussed (search these forums), the power of Inkscape mapping is at your disposal.
(I would recommend playing around in Inkscape with grids and snapping, but maybe that was just me trying to make it feel more like armabell map editor).
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

and where is 1,1 ?

edit: why is this in « wiki land » ?
Last edited by epsy on Wed Feb 06, 2008 12:05 pm, edited 1 time in total.
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

note that there's a ruler at the top. if you set the unit to pixels the inkscape/SVG/aamap coordinates should have the same scale.
There's no place like ::1
User avatar
ed
Match Winner
Posts: 613
Joined: Mon Feb 13, 2006 12:34 pm
Location: UK

Post by ed »

epsy wrote:and where is 1,1 ?
1, inkscape_page_height+1

Alternatively, you can build the map at 0,0 on inkscape, then when you're happy with it, select all and move it to the top left corner before you save it.
User avatar
Rain
Round Winner
Posts: 300
Joined: Sat Apr 15, 2006 2:59 pm
Location: a random empty server playing with bots

Post by Rain »

tank: move this to map forum please.
END OF LINE
QUARG
Round Winner
Posts: 223
Joined: Thu Sep 14, 2006 2:38 pm
Location: montreal

Post by QUARG »

epsy wrote:and where is 1,1 ?

edit: why is this in « wiki land » ?
Because the link to the circle generator in the wiki is dead. I would have put this in the mapping forum but i found that it related to this one more.
Thanks guys but i used inkscape all the time for mapping and for a simple circular map that i want the center of the map to be x=0,y=0, i find the generator was best for this application.
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

http://web.archive.org/web/200610141519 ... pse-maker/


8)

svg2aamap has the code behind the web version. I also have the web version on my computer...
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

In case anyone wants a version that works:

http://wrtlprnft.ath.cx/ellipse.php
There's no place like ::1
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

:(
Attachments
I am an ellipse too.svg.gz
(959 Bytes) Downloaded 191 times
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Your attachment isn't even an ellipse, it's a 63-gon. Weak actually, given that SVG supports ellipses as parts of path specifications AND as a separate tag (although only those with their major/minor parallel to the coordinate axes).

Also note that there's a separate map transformer (IE users: get a better browser).

Anyways, there's now a feature to rotate the ellipse around its centre, too. I wonder if anyone's ever gonna use it ;-)

I hope you don't want me to do perspective transformed ellipses next.
There's no place like ::1
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

If you're going to nitpick, it's a 64-gon. I did it this way because initially it made <Wall>s, but then converted it to write SVG instead because it's better for previewing. The fun part is that it draws the thing with only 4 trig calls in total (no other math calls, just standard stuff like addition and multiplication), and only 8 multiplications and 6 additions per point (2 of the additions are to move the center away from the origin). Beat that! :)
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Sounds like you used complex numbers as coordinates and used multiplication to “turn” them (could have used an orthogonal matrix as well, I just like complex numbers):
p_0 = 1
p_1 = e^(i*π/64) = cos(π/64) + i*sin(π/64); (two trig calls at start)
p_i = p_(i-1) * p_1; (i ∈ [2;63]) (two additions and four multiplications per point)

Then calculate a 2×2 matrix that will stretch the resulting points (interpreted as vectors now) by half the major/minor axis and rotate the result by some angle and apply it, resulting in two more additions and four more multiplications per point and two trig calls at start. Finally offset everything to move the centre to some point (two more additions per point).

I thought about doing that, but decided to calculate each point using separate sin() and cos() calls in my implementaion to avoild cumulative error. Besides, it's PHP, so sin() probably isn't much slower than addition.

In fact you might get away with fewer operations per point by reusing points. If the number of points is divisible by 4 you can calculate the first 45 degrees of the circle and then calculate the rest by inverting the x/y coordinates and/or negating the y and/or x axis. Beat that :-P
There's no place like ::1
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Heh. I did use complex numbers, but didn't have to transform them to get an ellipse, rotated or not. There's not a single matrix involved. Apparently I did pick the interesting approach.

Edit: No invalid XHTML, please. I only asked for 10000 segments. :P
Post Reply