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 Classic Chat / Converting 2D pointer into 3D coords

Author
Message
Alpha Mike
13
Years of Service
User Offline
Joined: 22nd Aug 2010
Location: Bristol, UK
Posted: 18th Nov 2012 21:42
Hey,

I am using the AppGameKit 108beta and I'm trying to work out how to convert the 2D pointer into some 3D coords.

I have a sneaky suspicion that these Get3DVectorXFromScreen, Get3DVectorYFromScreen,Get3DVectorZFromScreen functions hold the key but I've tried a couple of things to convert the normalised result but I just don't have a clue.

I am sure with the other commands available there is a way to achieve this but I just can't think how. Again my sneaking suspicion is it may have something to do with the FOV, Screen Width & Height and the direction we are looking in.

Has anyone managed this either with AppGameKit or another language?

Cheers,

Alasdair
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 18th Nov 2012 22:24
Here is an example of how to use these commands



The * 10 part will mean that the object will be placed ten units in front of the camera at the pointer position.
Alpha Mike
13
Years of Service
User Offline
Joined: 22nd Aug 2010
Location: Bristol, UK
Posted: 18th Nov 2012 22:30
oh! as easy as that eh!

I feel kind of silly now

Thanks!

Login to post a reply

Server time is: 2024-05-05 11:53:50
Your offset time is: 2024-05-05 11:53:50