How to use Unproject with orthografic camera

I can add spheres on a plane using the Unproject function and scaling it, like I do in

Now I want to do the same for a camera but in orthografic mode, but I cannot figure out what scaling I need to do.

Hello! Welcome to BJS!

You don’t need to unproject:


You have to set isPickable to true if you want to use pickInfo. Default for meshes created using builder functions is true.


Yes thanks, that could perhaps be a solution. I cannot add outside of the ground plane however. But I guess I can create an invisible mesh that covers the view.
Found something like that in

I think I might use this solution for the actual application and I appreciate your answer and time to make it very much. But I don´t think I will mark it as solved for now, because now I also have the academic curiosity on how to do it with calculations

1 Like

Yes, that’s the way I would choose. You have to add the spheres to something. If there is nothing to hit how could you determine the distance where to add the sphere?

No problem.

I wish everyone would think like that! :+1:

This uses the BabylonJS GUI. This is totally off…

This little debug helper might help you to see the values in realtime:

1 Like

I found a solution that worked. My problem was with the engine size for some reason i needed the width/height from the canvas getRenderingCanvasClientRect to get the correct width / height

 const mousePoint = BABYLON.Vector3.Unproject(
            new BABYLON.Vector3(
1 Like