# Converting window X/Y coordinates to ingame coordinates

## 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

##### 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)

#### Share this post

##### Link to post
What information would you require?

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

#### Share this 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

##### Share on other sites
Hidden
I was wondering, is Diablo II real 3D or 2d?

#### Share this post

##### Link to post
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

##### 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 this post

##### 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

#### Share this post

##### Link to post
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.

## 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