• Advertisement
Sign in to follow this  

Picking on a world map

This topic is 4905 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 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
Advertisement
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
Sorry, I've should explained it more clearly.

I don't know how to load bitmap image (any format) and check for pixel. I know to do it in DX9, but locking texture, khm. no way.

Share this post


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

  • Advertisement