I am exploring the idea of programming a territory control based RTS. These territories would be in 3D and I would like their colors to change when captured to represent the faction's color. I would also like if my borders be embossed to separate them more easily. Which brings me to my question. Is there a way to efficiently represent these territories to make them easy to modify and where I could track the borders efficiently and with precision?

For instance, lets say I have a map divided like the classic Risk map (ignore the continental colors):Classic Risk board game map

How can I represent each territory in a way where I could easily modify its properties (color, shape and possibly borders)? Should I engrave the borders in lists of coordinates and draw my territories according to these lists? Should I draw the map in an editor like Photoshop and analyse it pixel by pixel through a code execution to create the actual 3D map? Should I design each piece in a 3D modeling program (which seems insanely time consuming) and import the models when I load my map? Or is there a simpler answer right under my nose that I haven't explored yet?

I'm not sure yet if I'll be using Java or C++ to code, but I know it will be one of these two with OpenGL as my graphics library.

I understand that my question might be confusing, so please do ask for me to explain if it is the case and I'll try to clear any question you might have the best I can.


GIS systems actually use polygons for this kind of information, where each "ring" is a list of coordinates, so you can take the same approach.

Once your borders are defined in a list of points, you can triangulate them, assign vertex colors, or even apply UV values in order to apply a texture. Then the same mechanics apply as with a 3D model.

Polygons are sometimes produced from maps using the marching squares algorithm to produce a polygon, but if you can start with coordinate lists that would be less work.

| improve this answer | |
  • \$\begingroup\$ Thanks, this was very helpful. I will use these methods if I go forward with my idea. \$\endgroup\$ – The-Nexus Mar 15 '15 at 16:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.