Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How do I get the 3D coordinates of a point on a D3D window?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
flarn2006
Advanced Cheater
Reputation: 1

Joined: 27 Nov 2012
Posts: 73

PostPosted: Fri Dec 14, 2012 9:18 pm    Post subject: How do I get the 3D coordinates of a point on a D3D window? Reply with quote

I made a cheat table for Sonic Adventure 2 with all kinds of Lua features, like an object spawner. I'd like to make it so I can spawn objects by clicking where I want to put one, or click on an object to select it. Something to do the opposite would also be nice, so I could put a little mark on the currently-selected object. Is there any way to do this? If not, take this as a suggestion. Smile
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25295
Location: The netherlands

PostPosted: Sat Dec 15, 2012 4:05 am    Post subject: Reply with quote

This is something you need to implement yourself
First you need to find the projection, view and world matrix used by the game (game specific)
Then use that to project a vector from screenspace into object space and follow that vector

Then you need to build a list of all the objects (width, height, size, x, y. All game specific) and check which objects are hit by the vector.
Then pick the one closest to the screen. (Note that the gui, crosshair, windshield, foliage, etc... are objects as well so you may need to ignore those)

In short: It's probably easier if you can find a function inside the game that you can call instead

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites