Sign in to follow this  
Toni Petrina

Picking on a world map

Recommended Posts

I have texture which represents my world map (normal texture). I want to know which area cursor is currently over so I've made another texture of same size but using simply two colors : black and white where black is inaccessible area and white accessible area. But I don't know how to use this. I know that I should convert cursor position into map position and check color of pixel and then change cursor. How would you do this.

Share this post


Link to post
Share on other sites
How you convert the cursor's position on the screen into a position on the texture depends on how you are viewing the map. Is it a 3d view, or is it top-down (2d)?

If it's top-down, then it's pretty easy, but you'll have to be more specific if you want an exact answer. If it's 3d then it's more complicated, and involves working out where the cursor is in 3d space and projecting a ray in the view direction.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this