Picking on a world map
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement