Circle generator.
Circle generator.
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
http://generalconsumption.org/armagetron/
http://wiki.armagetronad.net/index.php? ... _Beginners
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).
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).
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.epsy wrote:and where is 1,1 ?
edit: why is this in « wiki land » ?
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.
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...
8)
svg2aamap has the code behind the web version. I also have the web version on my computer...
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
- Attachments
-
- I am an ellipse too.svg.gz
- (959 Bytes) Downloaded 191 times
- wrtlprnft
- Reverse Outside Corner Grinder
- Posts: 1679
- Joined: Wed Jan 04, 2006 4:42 am
- Location: 0x08048000
- Contact:
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.
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
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
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!
- wrtlprnft
- Reverse Outside Corner Grinder
- Posts: 1679
- Joined: Wed Jan 04, 2006 4:42 am
- Location: 0x08048000
- Contact:
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_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
There's no place like ::1