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 / Get3DVectorXFromScreen() and Orthographic Mode Issue

Author
Message
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 19th Apr 2021 01:33
Get3DVectorXFromScreen( X, Y ) doesn't appear to work with SetCameraFOV(1,0) (Orthographic Mode)

Suppose I could do it manually via OrthoWidth, AspectRatio, and CameraPosition...
PSY
Developer
8
Years of Service
Recently Online
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 19th Apr 2021 02:07
You might want to have a look at these threads:

https://forum.thegamecreators.com/thread/222016 and https://forum.thegamecreators.com/thread/221723


PSY LABS Games
Coders don't die, they just gosub without return
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 19th Apr 2021 04:36 Edited at: 19th Apr 2021 04:38
I found, after tinkering with it a bit, that it appears Get3DVectorXFromScreen() gives a position on a plane intersecting 0,0,0.
This is still useful, it saves me a few steps in getting a correct RayCast.
Here is the hack/fix I've used for my MouseRayCast() function:
Nieb
10
Years of Service
User Offline
Joined: 13th May 2014
Location: Lurking
Posted: 19th Apr 2021 05:31 Edited at: 19th Apr 2021 06:07
Here is a version that supports near clipping:


It uses some of my internal code, but I'm sure you can figure it out if you need it.

Login to post a reply

Server time is: 2024-11-21 17:34:02
Your offset time is: 2024-11-21 17:34:02