Screen position
Good evening. I''ve a bit of a problem...
All I need to do is take the screen (X,Y) coordinates (-1 to 1) into world-position coordinates. My Z+ axis the the "vertical", and my camera is looking down at a variable angle, like in 3D RTS games (ie Earth 2140 + 2150, Z:Steel Soldiers, Ground Control). I am using Direct3D, in DirectX 7.
The world itself is a heightmap grid, in a 2-dimensional array. I have a function already built to find the exact height of the terrain at any (X,Y) position.
I want to find the world (X,Y) position that I am clicking at, basically.
Any help will be highly appreciated... thanks!
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
What you are looking for is something called "Polygon Picking" I know Nehe''s site contains information on how to do this in OpenGL, but you should be able to find plenty of examples. For instance Direct X 8.0 has a sample app called PickPoly which does what your looking for.
Joseph FernaldSoftware EngineerRed Storm Entertainment.------------------------The opinions expressed are that of the person postingand not that of Red Storm Entertainment.
If I had the DX8 SDK, that might help. Can''t download it... 56k modem. I will be getting cable, though... next month!
Perhaps something else that will help is that I''m working in VB6, Enterprise Edition. I''m learning, and can read, C++ though, so don''t be shy with other languages.
So... again. Any chance of help?
Whoohoo!!
Perhaps something else that will help is that I''m working in VB6, Enterprise Edition. I''m learning, and can read, C++ though, so don''t be shy with other languages.
So... again. Any chance of help?
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement