World: r3wp
[gfx math] Graphics or geometry related math discussion
older | first |
TomBon 10-Feb-2011 [168] | advise on how to colorize individual countries in a worldmap? take a worldmap, draw background borders between the countries and then floodfill the country via a central coordinate. is this a effective approach? |
DideC 10-Feb-2011 [169x3] | Not enough probably as you might jave country border touching other border of the same countryy. Countries are not simple polygon ! |
My first though is to have a map (an image) of countries where each country has its own color (call it a color-map) and another map of the same size that you display (diplay-map). Then you have a block of pairs [country-name country-color]. So like this you have a relationship in any sense. Click the displayed map => find the corresponding pixel in the color-map => find the country name in the block. To know the edge of the country you want to fill, just find all the pixels of this same color in the color-map and poke the corresponding pixel on the diplay-map. | |
jave=have | |
TomBon 10-Feb-2011 [172:last] | yes, a precolorized map would make things simpler. thx didec... |
older | first |