Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / 3D object to screen XY

Author
Message
JRNTexas
12
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 28th Jun 2020 04:57
I'm using a sprite as cross hairs on the screen and would like to know which 3D object the sprite is over. Thanks for any help.

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Jun 2020 06:00 Edited at: 29th Jun 2020 00:40
This should do the trick i think. It gives you the object under the mouse position.
If you want a particular point then change references to GetPointerX() and GetPointerY() to your x and y values
The 10000 value is the distance from the camera that it will check so if your environment is larger, increase that value

JRNTexas
12
Years of Service
User Offline
Joined: 24th May 2011
Location: Austin, Texas
Posted: 28th Jun 2020 16:24
@blinkOK ~ Thank you!!!! Your routine works exactly as is!

Login to post a reply

Server time is: 2024-04-20 09:18:24
Your offset time is: 2024-04-20 09:18:24