# Converting window X/Y coordinates to ingame coordinates

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

## 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 on other sites
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)

What information would you require?

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

##### 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 on other sites
Hidden
I was wondering, is Diablo II real 3D or 2d?

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 on other sites
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 on other sites
Hidden
If your using openGL you should look at using a pick ray with gluUnproject

some more stuff there:
OpenGL FAQ

Quote:
 Original post by Anonymous PosterHowever, 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.

• 33
• 12
• 10
• 9
• 9
• ### Forum Statistics

• Total Topics
631353
• Total Posts
2999488
×