ASCII-Globe

GitHub Repo

Have you ever wanted to see what the Earth looks like in text form?

Well, allow me to introduce ASCII-Globe, a program I made that dynamically renders the Earth in ASCII art.

Demo

A spinning globe rendered with text

Here's a flattened text version. Feel free to copy and paste it.

..........................................................................................................................................................................................................
.........................................................      ............           .................................................................................................................  .
...............................................         .........          .....:::....       ................................    .       ....... .....    ...............................................
.....................................   .      .:.;..g....YVW.L.gwwiooi.....W.YVV.WWWX.g.''.,. .. .........           ..      .................  .... ....:.    ..........................................
................................     ... ...:.;o.W.HX.W..@V.Oo....V@@@@@@@@@@@@@@VVVVVVVVWg,:..............'.,ooiii'............;......... ..............o..i;..     ..........       ....................
    .. .. ..................... ....',i,.:.io,wg'.goHWY..o. ;o.YVVV@@VVVVVVVVVVVVVVVVVV.Y.'  ...............,oH.;i;.................  .....:.........  .  .:;i...;;;....................    .. ........   
.............................. .,ii.g..io';..O...LLo..g..  ...;.;;;,OVVVVVVVVVVVVVVVVVV.WL'...... .........  ..   ................  ,.g.,...      ...'..OHW.....V.YWo         ...;gg.w;;,;.......... .....
..........             ..     :WV.XH.oi,w...oW.g..,.L.HLgO,.         ..V@VVVVVVVVVVVVW.Lo;........................ ...............,.L'.    .g,.;''.LX.VVVVVV.WY.Y...X..O.iLL., ....,..,,,.    ..   ....;..
;.........,.gOoiw,.;;..  ..:;.:,i:;X..@@VVLw;,.WH:;L.WVWW.VW..,. .....og.VVVVVVVVVV@VW.Li ...................   .;,.ww..    .  .. .g. ... .Y@L.WWVY.VV....YYW...VVV....VVVVVVWoH.HHWVV.....gOOi......;;:..
...  . ..HV@@@@@VVV.YW.LLHXWWY..W.L.L.LLLHX.'i.oWVL.'...;,LL.@..;.... ;.LVVVVVV@@@WLOow.      .............. .w...W..X.LLL.. .'...i...OWWXOHV..W.VVV.WWWW...YWW.WWWW.HH.HX.W.VVWWWV.YYWWWY.V.V..WWW.LV.YW.
XWWXO:.wOOHYWW....L.L.W..W.W.H..g.XV.WWWYV.YVV..VV@VH.o. ;,o.X.L.L: . .H.VVVVV.HL..    ..;,.w............   w.XO.';.ggw,,.og'.L.X..WWWWWWWWWWLX.YYYWW.HWWWWWW..WWWWW...X..XWV.W.WW.V.Y..YWWW.WWY.VV.V...VV
  :.;:.;iwgHHLL.XL.LX..XH.WY.WX.LX....WW..V.WW..VVL.i....w'..W.Ho..... :H@@VVY.    .....;iOg,. ........  .;oHO.w....OOO..,.g.LOOLLO.LLg.OLO.WYYWYW..LLLXX....L.XXH...LOOL...WWWY....WWY.YWWW.VVV.W...VVV.o
.    ...LW...XWWXW.HWW..LO.HWWHLX..Lig..WWYWWY...;   .;..oL.i,',; ..... .O.VV. ........       . .. .   .o..HLg,...Lo...O.OHLOLLOLLLOLL.L.X..WWWW.W.H.OOOLLLLLLL...X.LO.L.XHX..XXHW...VVVVV.V.og.gWVY..g..;
. .....:..L..WL,w..;',.L....O.Og.OOLLLLL..X.W....   .. . X@VVW;..' .....  .;' ...................   .   .H.,,,.. .,iwgigLOOLO.g..O.OLO.L.HW.XHXXXH.HHX.OOO.OLLLLLLLLL.XLOLLLLL.L..Y.Lgogo.Lg. :.gw..;.    
...  .    .;i,'.        ;,.H....ig.O..gL..L..L..Wiw;   ...WWWY..V.,  .....   ...............  .  ...    ....,'   .wXLggoLLO.LO.OHLLX...L..HHHH....L.LO.LOLOOgog..O.HWWWWW..WW....XO,.       ;LW.,     ....
.   .....;;;.  .........  .,LOi.g..g.O....g...OL..WWLgi ,g.H...H..Xi; ........................ ....;.    .;...:.,..O..OL.LX.L..HX.W..L.WWWWYYYYYWW.X.XO.L.L.oO..go.HLOOXLOOLO.HX...  ...... .V.o......... 
..........   .............. ;ggogLLgL..W.XXLg..Og..O.YW.,W..HX..LLOLL. .....................   ....;;: ...;;..,iw...,,ggOWYW.WW..Y..WX...VV...Y.YWWW..OOO.gOXL..iwoow..o.i.i..O..go.i. .... ,..  ... .. ..
......   ................... .igiwgOgO.WWYWY.......g...LOL...O..io.,w.   .....................    ...:.....;;''...',w....HWWH...VV...VVVVVV...YYYWWW.LXXOL.LH..iOi;...W.O'.OLW,.igo,.. ....... ...........
.   .........................  .;i'',ww...W.LH..'i.;;.iog..ggg.i..  igw. .. ...................   ...;;;...,.;;;;.',,,w.,i....LWYHXVVVV..VV..V.WWW.WWY..g..YLw.L..O..V.V.,.Vg.'.i,;..; . ...  ........... 
....................................',.w.....w.';.;;:..,i,.ig.;,.... .....  ....................    ....,.w,;.;..;.;........;...';oH......g..HOLHL....V..LL..g.oo.XW.WW.i.LWg;.g.:. :. .... ..............
.................................w.,igL...w,,,,,,,.;.i,i.;;;;:. ..       ............................;;:'......;;;;;;.  .  ....; ..oOi....,,w.ioO...XO..Ogo..goo...g.gLo..,g,..,.. ..i....................
.............................. ...gLLO....w,,,w,,.w.,.w.;';:..    ..............................:;.;.;.  .......;;.;...:..;;.Ow,. ;.i.i.ow.'.gH.O.L....g........ggo.ww,.,,..;;. .. .:.. ..................
.............................. .;w.goi....,,,....'..,.;;;;;.  ................................ .;;','    .. ... .;..;',...X.WWgw; .i.i.oi,,....g.gggg....gLOi.gg...,,,,.:..;.  ..  ..  ...................
............................... ..iw,,iw..,,,''.;;';;;.;;;. ......................................;:.......... ......;;.w,,,wo..,..,w.w.wwiwLVWO.gOggLL.O..L.,wi.w,.',w,;. .;.   .........................
....................................i,,,,,,,...;.;;;;..;;......................................  :;.,.i...i.  ..   . . . ,g...ww.iiii...wOHgii...ogogggg..ii.w,,.'''.,,,;. ...............................
.................................  ;i.,.w.ww...;.;;......  ......................................,.oggOOLX..,;  :,:..   .igggo.wo...i.....oi,,',.gio..o.ii.,,,.;...;....,;    ...   ......................
.................................. .;;w.,.w,.;'.:;...... ....................................  ;......O.L..O.Og..XL.giw.go.O..g.,ig..iiggg.i..w.;,..i..i.i...';....;.;;;''     ...........................
................................... .'.;;,w,'...  .   ...................................... .,igOgOOg.gOOggg.gLLLXXXL...igLgO.L..w..i.ig.oi.g..,';',,,,,;..;......;;.;:..   .............................
.........................................;w.... .....  :... ............................... ...gLO..Lg..gi.gL.gOXL.LLLLg.;o..gg.L, ;;;,ww,.ig..w,,.''..;;.:.:.;;;.:;.....   ..............................
............. ....................... ....'w,;. ..   ....;..................................gO..Ogg.L.ggoO..L.LO.L..LL.gi.;.ggg.LL.go;.   .,ow..;''';...;:...:.;.;;.;.....................................
...................................... . .;,.;.   ............  .......................... ,Lg.L.OO.L..O..L.g.....L.LL.gg, ..g.LLLLOL.: ..  ;...';;;;;:.:.,.:::.;:;...  . ................................
............ ..............................;;.;...::.    ................................. ..O.LLXXL.gOL...XXL.g.O.L....gi..w..LL..X.: ..... ....';;..   .;...... .   ....................................
............. ............................ .......:....... ............................... .gg.gO..Oggg.ggL..XXL.gLL..gg... ...L.Li.. ....... ;,,.;.  ... ;';;.... .... .. ...............................
............................................  .......:. ...    ........................... ;.www.oi..gggg.....L.ggggggg.www,.,o.,.   ........ .,w'. ..... ..;.,.... ... ... ..............................
................................................. .....  . ....    ....................... .;;;',www.ww..o....i.w.i....w..,ww;................ ..;.......   ..:;;;. ...  .................................
...................................................  .... ...;..::.. ...................... ..;;;.....'..,ww,,.';.,,,...;;,,ww,ig, ........... .'. ..... .. .  :;. ... . .................................
..................................................... .......;';;;:..   .................... .::.;;;;;;;;'.;;;;;..;;.';...,.,..o.. ............ ..: ....... .. ..  .. . ...:..............................
...................................................... . .:.;;;:..:::...  ................... ..:.:::...;...........;;;..';;w.,i: ...........  . ........... :.      .:. ... .............................
........................................................ ...;::....;.:..:. .................... ..      ...::::..:.::.;;,w,.,.,: ............  ... .............   ..::. .  ..............................
....................................................... ...::::...::::..;'   ...........................  .:::::..::.:..'.,w... ........................... ....  :...:........... .......................
...................................................... .;:::::...:..:..::....   ..........................:::;:::.::....;;',:  ............................. .... ..:........ ......   ... ...............
...................................................... :;:::::::::::...:::.;;;;.  ....................... .:.;..:::::.;.,,,. ......  ...........................:....:..:..... ...:.... .... .............
...................................................... ;.::::.:::::::::..;;;;.,,.. ....................... .;.:.......;.,,;........  ........ ...............  .:...    ... ..... .::::....... ...........
....................................................... ;;.:...::.::::.:;;;;;.,,w. ........................ ..:.......;'.';. ................ ................. ....:..........   :..:.:..................
.......................................................  .;:::..:..:.....;'';.,w; ......................... ..:..::...;';'': ... .....  ........................     .......      ..:. ... ...............
........................................................ .,;.::.....;;.;;;'';'.. .......................... .;..;;::.;;..'.; .. .. .... ..............................   .    .';:  .. . .................
......................................................... .ww..:..:;';';;;..;';........................... .,;;;;.;;;;'';;.'   .;. ...  .................................  ;';.,,.  ;................... .
 ......................................................... .,.,';;..;;''''..';'. ......................... ...w,,,,,..,.';.. ..,; .....................................  ..,w,,,,,;..w;   ....... ..... ..
...........................................................  'g.,;...'..'''.;;; .......................... ..iww...w,,,...   .,.. ..................................   ..,.ww,,ww....,,:  ...  ... .......
............................................................ ;go,;';;;'..''';;. ........................... ..w.i..iw,,.; .. .w'......................................',wwwwww,,,wi.ii..;.  .  ......... .
............................................................ ..i.;;;.;'.'';... ............................. i......,,.,'... ;.; .................................. ..,,,,w,ww,,,w.....,,;  ..... ........
............................................................ 'i.';;..;;;..    .............................. ,oi.giw,.'..... ...................................... .,w,,,,,,,,,w.ggi.w,..; ..............
........................................................... .w.w.'.;.;..;. ................................. ..ii.,ww.'. ....   .................................... ,w,,,,,,,,'wg.g..ww,.;. .............
........................................................... .w.,.,.'''... ................................... :...ww,;. ............................................ .iw,',i.,wwwii.o.,.,.................
........................................................... .w.,,,.''... ..................................... ,.w,.;. ............................................. .wo,..;....'w,...,w,;. .......... ...
........................................................... :ww,..';...  ...........................................  .................................................:...     ..;w...,.. .......... .  .
............................................................;ww,...';  ........................................     .................................................     ......   .,,'.:.......... ......
.......................................................... ..,ww,,;.  ............................................................................................................. .... ..........    ...
.......................................................... ..,,w..   ................................................................................................................ ... .........  :... 
   .......................................................  ;,w..   ...................................................................................................................................   
.......................................................... ;,,w;   .............................................................. .........  .......................................... ......... .;:  ...
.......................................................... ii,...    ..................................................................... .. ....................................................   .... 
.......................................................... w,,;    .. .........  ......................................................... ..  ...........................................................
.......................................................... .;;;.   ........................................................................  ....................................................... .....
.............................................................;;.. .  ............. .......................................................................................................................
............................................................    ...............  .........................................................................................................................
....................................................................  ....................................................................................................................................
.................................................................  ........................................................................................  .  ........... ..... ........................
..............................................................   :.w..........................................................            ........         .. ..           .     .        ................
..........................................................    .;.Y..  ..............................   ..        ...          ..;.OLo.;...        .w,oi,..gV.LXWO.,.LL.,'oO..gO.LYL.,.....      ..........
...........................................    .............'...V..: .......................        ...  ....;...  ..:'.i,:'gL.WYVVVVV.WW.HXg......VVVVVVVV.VVVVVVVVVVVVVVVVVVVVVVVVVVVYV...i':...   .....
.......................  .                 .....          ;g..W..Y.' ..................     .,woOLL.WW.XX.W.W..WW..X..VVVV..VVVVV......VVV.YVVVYVVV....................................V.VVVVVW...O,. ....
............  .        .. ....i,.;:.......;OWWYXLLL.o,;,oL..W....Y.;    ..... .....    :.wL.WVVVVVVVV.VVVVV...VVVV..VV..Y.V..............YWW...Y................................................WW.o:.....
            .. .wioOX..H.X....VV...YYW.W.H.....VVVVV@VVVVVVV......Hi,;..     :     ..;O.YVVVV...........................V...................V.................................................YW.. .      
.,;;;::....,.WXWVVVVVVVVVVVVV.........VVVV..........WW............V@VVW..Oow'.w,....W.V.V................................................................V....................................WOLi...goow.
@VVV......VVVVVV...................................V.WY...............VVVV@@VVVVVVVV........................................................................................................WHH.VV@VV@@@@@
.VVVVVVVVV...VVV.VV.......V.VVV.....................VV........VV.V...........Y..........................................................................................V...V...............W.XH.YWY......
YXWWWWYWWY.Y.YWY..............Y.................................YW..WW......................................................................................................................YY......XWWW.Y
.WY..Y.WWWW.WW..YWHW.YYY..WYYYW...........V.VV...............Y......VVV...................V....................V...............V...............................................................VV.........
VVVVVVVVVVVVVVVVVVVVV..VVVVVVVV..VVVVV..V...VV..............VVV.VV.............................VV.V..V......VV..............V....................................................................VVVVVVVVV

Rendering

ASCII-Globe uses a bit of Python code I wrote that renders text onto a simulated 3D sphere.

It does this with the same trigonometry that all rendering engines use, so I won't explain it in detail here.

ASCII-Globe also supports features such as rotation, tilt, scale, and a day-night cycle. It accomplishes the day-night cycle by switching between a day texture and a night texture, and the rest are achieved with more trigonometry.

Texture Generation

ASCII-Globe works with any 202x80 character .txt file, but for the people who don't want to manually design a 16,160 character texture, it also comes with some image-to-txt code. The texture generator's default behavior (as described in the documentation) is to download this image taken by NASA satellites and convert it into text. However, it'll work on any image; it doesn't even have to be a map.

Animation

ASCII-Globe also comes with code to generate animated GIFs from a list of frames. It uses a monospace font like most ASCII art to maintain text column alignment. The default behavior is to render white text on a transparent background, but the code comes with lots of parameters to customize the output.

Installation

If you want to use ASCII-Globe yourself, follow the installation instructions in the documentation.

Conclusion

ASCII-Globe was a delightful project to develop, and coding it taught me a lot about graphics programming. I hope you find it useful, or at least amusing.

~Ethan