Solved

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

Posted on 2004-09-12
3
298 Views
Last Modified: 2013-12-26
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
Comment
Question by:zekard
  • 2
3 Comments
 
LVL 17

Expert Comment

by:davebytes
ID: 12047238
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
 
LVL 17

Accepted Solution

by:
davebytes earned 100 total points
ID: 12096204
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question