- Home /
Trying to program a world globe that...
When you mouse over a particular country it'll highlight that region. I have a sphere right now with a world map texture on it that is mapped correctly. However I'm not sure how to start with highlighting different regions. I'm not talking every country every, just larger ones.
Example: When I mouse over the US I would like that portion of the texture map to turn to a slightly darkened version of the original texture map. Do I need to make multiple texture maps for each country? Or is there an easier way?
Answer by AVividLight · Mar 10, 2011 at 07:17 PM
You can make different textures for every country that you want highlighted, and then have a ray fire from the mouse, can have the countries "tagged" or have an object in front of them so that when the ray hits the object (or tagged area) it will change textures...
-Hope I helped
Ok I think I have an idea that'll work. I'll break the sphere into multiple objects and then split the texture map into separate sections for each country and just map them individually and change the color within unity.
Answer by DaveA · Mar 10, 2011 at 11:00 PM
You could have a 'hidden' map (single bitmap) where each country is a different color. Rayhit will tell you what color, hence what country. You could then muck with things to mask out all but that color and add (or whatever) to the regular map texture.
Answer by Kronnect · Dec 08, 2015 at 11:53 AM
The efficient way would be to use a vector/procedural approach which works by checking sphere hitpos location against a geodata database with frontiers. Then ir should create the highlight surface in 3D automatically on the fly. This approach is used by World Political Map which I encourage you to check out since it will be a great time saver for you.
Your answer
