Screen position to world position

in this case
if I change the camera like this
camera.orthoLeft=-118;
camera.orthoRight=118;
camera.orthoTop=118;
camera.orthoBottom=-118;

the world position will be NAN

minZ/maxZ only have interest with perspective camera. for Otho, use -depth/+depth

Check line 74:

thanks the position is not NAN anymore.
But still if I change the camera like this
camera.orthoLeft=-118;
camera.orthoRight=118;
camera.orthoTop=118;
camera.orthoBottom=-118; the position is not correct. https://playground.babylonjs.com/#45L4XL#16

I’m not sure why you don’t use scene.getProjectionMatrix() and scene.getViewMatrix() in the ortho case? These have valid values even in this case:

2 Likes