Solved

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

Posted on 2004-09-12
3
287 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now