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 / [SOLVED] App Game Studio (Basic) ? 3d object on screen 2d location

Author
Message
Timidon
18
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 14th Nov 2022 05:43


Still trying to figure out how to find this. I am looking at retrieving or creating a 2d position for sprite addons to 3d objects on the viewed screen. What command can retrieve the 3d objects' 2d screen position?
Watch \"StarCrash\" a 1979 epic film, make sure your not to sober..

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

Zappo
Valued Member
19
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 14th Nov 2022 11:51
Hi Timidon,
You can convert a 3D position to a 2D screen position using these commands:
GetScreenXFrom3D(x,y,z)
GetScreenYFrom3D(x,y,z)
A couple of examples of their use is available here: https://www.appgamekit.com/documentation/Reference/3D/GetScreenXFrom3D.htm

If you need to go the other way round, i.e. convert a 2D screen location to a 3D coordinate, you can use these commands:
Get3DVectorXFromScreen(x,y)
Get3DVectorYFromScreen(x,y)
Get3DVectorZFromScreen(x,y)

Hope that helps.
Timidon
18
Years of Service
User Offline
Joined: 26th Jun 2005
Location: Bakersfield, Ca. USA.
Posted: 14th Nov 2022 20:34 Edited at: 14th Nov 2022 21:17
This post has been marked by the post author as the answer.
God, has been 17 years since I have been visiting these forums!... well thanks for the help and example.
Thanks for the example!
Watch \"StarCrash\" a 1979 epic film, make sure your not to sober..

Login to post a reply

Server time is: 2024-03-28 10:17:09
Your offset time is: 2024-03-28 10:17:09