• Advertisement
Sign in to follow this  

Converting window X/Y coordinates to ingame coordinates

This topic is 4105 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 reading a bunch of stuff, and I'm pretty confused, my question is: How do I convert window X and Y coordinates ( (0,0) through (800x600)) to "Diablo II" ingame world coordinates ( (0,0) through (20000,20000) or so) -- I know the world X and Y underneath me; here's a picture to visualize it: http://img525.imageshack.us/img525/4051/d2coordsclickap7.jpg I'm really sorry if this is uninformative, or is very common; I don't even know how to articulate my question very well. Thanks for giving me the time of day, though, and I appreciate any responses :)

Share this post


Link to post
Share on other sites
Advertisement
Hidden
I can't help you with Diablo II as I don't know anything about it, but you should look into projections (look on the internet there are quite a few resources on that)

Share this post


Link to post
Guest Anonymous Poster
What information would you require?

Thanks for the reply, I'll definitely look up projections :)

Share this post


Link to post
Share on other sites
This process is usually known as 'picking' in 3D -- you need to project your screen coordinates into world coordinates, taking into account your current "scroll" inside the world (if the world coordinate system is larger than the screen coordinates).

Searching for isometric picking might help.

Share this post


Link to post
Share on other sites
I think Diablo II is isometric. The same technique should work though if you have the objects you're picking from in genuine 3D coordinates; an isometric view still has a projection matrix you can use for picking.

If you don't have the heightmap for the ground then you can only approximate based on the X and Y axes on the ground and the screen.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Alright, thanks guys; I've got something to research now.

However, it's hard for me to find resources, but I'm looking! If you know anything off hand, or don't mind searching, I'd really appreciate it :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
However, it's hard for me to find resources, but I'm looking! If you know anything off hand, or don't mind searching, I'd really appreciate it :)


Diablo II is, as far as I know, isometric. There is a whole bunch of fantastic resources right here on GameDev on this subject.

You might also look in on the Isometric Land forum here as well.

Good luck. Isometrics are not easy IMHO.

Share this post


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

  • Advertisement