Koch's snowflake
- wrtlprnft
- Reverse Outside Corner Grinder
- Posts: 1679
- Joined: Wed Jan 04, 2006 4:42 am
- Location: 0x08048000
- Contact:
Koch's snowflake
I made some maps (using a script) in the form of Koch snowflakes (if you can read german you wanna read the German article, which is much more detailed).
I just made them for fun and because they look nice, but don't have any real use for them, so feel free to turn them into fortress maps or shooting or whatever. These maps are pretty wallhugging-safe, too. Oh, and the 6th iteration even beats my tronsector map in size (and is probably unusuable for all practical purposes).
I just made them for fun and because they look nice, but don't have any real use for them, so feel free to turn them into fortress maps or shooting or whatever. These maps are pretty wallhugging-safe, too. Oh, and the 6th iteration even beats my tronsector map in size (and is probably unusuable for all practical purposes).
Last edited by wrtlprnft on Fri Sep 29, 2006 8:43 am, edited 1 time in total.
There's no place like ::1
- Tank Program
- Forum & Project Admin, PhD
- Posts: 6711
- Joined: Thu Dec 18, 2003 7:03 pm
- Tank Program
- Forum & Project Admin, PhD
- Posts: 6711
- Joined: Thu Dec 18, 2003 7:03 pm
- Tank Program
- Forum & Project Admin, PhD
- Posts: 6711
- Joined: Thu Dec 18, 2003 7:03 pm
Here are the phps I came up with after having some of the formulas.
http://electricpotential.net/koch/
3 is the final version. Add ?stage=x where 0 <= x <= 6. Going much higher than that eats too much cpu as it starts getting super complicated. It was hard enough to get it to draw that. I essentially made a class representing a side and... I don't even remember now, but it wasn't easy.
http://electricpotential.net/koch/
3 is the final version. Add ?stage=x where 0 <= x <= 6. Going much higher than that eats too much cpu as it starts getting super complicated. It was hard enough to get it to draw that. I essentially made a class representing a side and... I don't even remember now, but it wasn't easy.
- wrtlprnft
- Reverse Outside Corner Grinder
- Posts: 1679
- Joined: Wed Jan 04, 2006 4:42 am
- Location: 0x08048000
- Contact:
Looks nice
Anyways, modified my script a bit to create SVGs and uploaded them to the Wikimedia Commons (only the last 8 are mine)
Anyways, modified my script a bit to create SVGs and uploaded them to the Wikimedia Commons (only the last 8 are mine)
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
Classes representing sides? Seems like you're making it harder than it is. I have my own working generator in C using only integer math (easy to transform in the callback), and there's hardly 10 lines of actual code per type (guaranteed inside or guaranteed outside polygon). Still more redundant than it could be.Tank Program wrote:Here are the phps I came up with after having some of the formulas.
http://electricpotential.net/koch/
3 is the final version. Add ?stage=x where 0 <= x <= 6. Going much higher than that eats too much cpu as it starts getting super complicated. It was hard enough to get it to draw that. I essentially made a class representing a side and... I don't even remember now, but it wasn't easy.
- Tank Program
- Forum & Project Admin, PhD
- Posts: 6711
- Joined: Thu Dec 18, 2003 7:03 pm
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
Mine draws on a grid like this:
I have a direction table (to 'turn' I just change the index) and a bit of recursive code working on a single point (shared by passing a pointer). There's nearly identical code that calculates the outside. Again, it's easy to fix the aspect ratio afterwards. It should be made √3 times as high.
It doesn't calculate the perimeter or anything, but you don't need plotting code for that. Maybe I'll add it sometime. First I'll be working on a little experiment.
I did it without syntax coloring.
Code: Select all
• • • • • • •
/ \
•---• • •---•
\ /
• • • • • • •
/ \
•---• • •---•
\ /
• • • • • • •
It doesn't calculate the perimeter or anything, but you don't need plotting code for that. Maybe I'll add it sometime. First I'll be working on a little experiment.
I did it without syntax coloring.
- wrtlprnft
- Reverse Outside Corner Grinder
- Posts: 1679
- Joined: Wed Jan 04, 2006 4:42 am
- Location: 0x08048000
- Contact:
Anyways, getting bored of koch and made some maps representing Sierpiński curves. 1 to 3 might be used for 4 or 12 team fortress (or 44 team, though that would be weird), all above eat way too much framerate to be useful, and 0 is rather boring.
As a waste product there's some random crap that resulted of a programming error but looked cool and something similar to the koch curve, but with squares instead of triangles.
Hope some fortress guy turns them into maps for CTWF
As a waste product there's some random crap that resulted of a programming error but looked cool and something similar to the koch curve, but with squares instead of triangles.
Hope some fortress guy turns them into maps for CTWF
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
We're overloading the server that draws all those maps.
The Sierpiński curves could make for some interesting mass-team games. Just make sure teams are spread evenly.
The Sierpiński curves could make for some interesting mass-team games. Just make sure teams are spread evenly.
Code: Select all
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
...
This is a Sierpiński curve