• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

Hook OpenGL API calls to aquire x,y coordinates of an object?

I'm trying to aquire the x and y coordinates of say a peasant, or a building in Warcraft III. I have a handle to the warcraft window and can simulate mouse movement and clicks as well as keyboard input. My question is how can I figure out the x,y coordinates of objects ( building, units etc. )? Would windows hooks be adequate in this situation? If someone couldpost an example of doing something like this i would be very much appreciative.
0
zekard
Asked:
zekard
  • 2
1 Solution
 
davebytesCommented:
Not that I know of.  The underlying data is all proprietary and hidden away -- there isn't anything that would allow you to figure out what is onscreen.  Sorry.

-d
0
 
davebytesCommented:
Even moved, still the same answer.  A given triangle rendered through openGL could be anything.  A triangle fan or list could be anything.  You'd basically have to write a complete stub OpenGL DLL, with EVERY call captured that has to do with primary data state (texture, shader, rendering, etc), and empirically try to mouse around the screen and use what was captured last frame to tell you what data seems to be attached.

However, since there's no guarantee that the texture IDs will remain the same between any two runs, you again can't realistically do this.  Also, if they've at all combined texture maps, or use shaders, it becomes difficult in many cases to separate out what is the 'key' data for a triangle being rendered.

And the speed slowdown for patching critical calls, buffering up ALL the data for the last frame, is going to be huge.

-d
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now