Jump to content
  • Advertisement
Sign in to follow this  
pompoko

Overlaying a sphere with selectable country boundaries

This topic is 3500 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm a beginner and don't know how to properly implement this. I need selectable countries on a world sphere. The countries might have different colors and overlays according to their game state. I will have the country boundaries as simple paths (svg or something similar)... now, how would you represent and draw them in 3d?

Share this post


Link to post
Share on other sites
Advertisement
The easiest solution is probably to render the countries' outlines to a texture (using some map projection) and map it onto the sphere.

Share this post


Link to post
Share on other sites
That's what I thought, and I'd use a 2d representation of the borders internally, get the coordinate of the mouse on the sphere and project it respectively to see what country was 'selected'... that might work?



Share this post


Link to post
Share on other sites
I would have a 2D texture that has the countries as different solid colors.

Then when the user clicks the sphere you can transform that from the sphere's coordinates to the textures coordinates, after that check the Color of the selected pixel and see what country that corresponds to.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!