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:
FUNCTION MouseRayCast(ObjID AS INTEGER, Depth AS INTEGER)
MouseX AS FLOAT : MouseX = GetPointerX()
MouseY AS FLOAT : MouseY = GetPointerY()
Mouse3dX AS FLOAT : Mouse3dX = Get3DVectorXFromScreen( MouseX, MouseY )
Mouse3dY AS FLOAT : Mouse3dY = Get3DVectorYFromScreen( MouseX, MouseY )
Mouse3dZ AS FLOAT : Mouse3dZ = Get3DVectorZFromScreen( MouseX, MouseY )
RayStartX AS FLOAT
RayStartY AS FLOAT
RayStartZ AS FLOAT
RayEndX AS FLOAT
RayEndY AS FLOAT
RayEndZ AS FLOAT
// When in Ortho Mode Get3DVectorXFromScreen() appears to give a position on a plane intersecting 0,0,0. The plane is orientated as the Camera is.
IF Viewport.IsOrtho[Viewport.Active]
// Offset from Camera.Position
RayStartX = GetCameraX(1) + Mouse3dX // @fix offset to near clip plane
RayStartY = GetCameraY(1) + Mouse3dY
RayStartZ = GetCameraZ(1) + Mouse3dZ
DeltaX AS FLOAT : DeltaX = Mouse3dX - RayStartX
DeltaY AS FLOAT : DeltaY = Mouse3dY - RayStartY
DeltaZ AS FLOAT : DeltaZ = Mouse3dZ - RayStartZ
// Normalize
DeltaL AS FLOAT : DeltaL = sqrt(DeltaX*DeltaX + DeltaY*DeltaY + DeltaZ*DeltaZ)
DeltaX = DeltaX / DeltaL
DeltaY = DeltaY / DeltaL
DeltaZ = DeltaZ / DeltaL
RayEndX = RayStartX + ( DeltaX * Depth )
RayEndY = RayStartY + ( DeltaY * Depth )
RayEndZ = RayStartZ + ( DeltaZ * Depth )
ELSE
RayStartX = GetCameraX(1) // @fix offset to near clip plane
RayStartY = GetCameraY(1)
RayStartZ = GetCameraZ(1)
RayEndX = RayStartX + ( Mouse3dX * Depth )
RayEndY = RayStartY + ( Mouse3dY * Depth )
RayEndZ = RayStartZ + ( Mouse3dZ * Depth )
ENDIF
TheObjectHit AS INTEGER : TheObjectHit = ObjectRayCast( ObjID, RayStartX, RayStartY, RayStartZ, RayEndX, RayEndY, RayEndZ )
ENDFUNCTION TheObjectHit