I’m new to babylonjs, switching over from Unity.
I’m trying to project 2d coordinates into 3d space kind of like this:
Unity has a really helpful function called Camera.screenToWorldPoint(screen.x, screen.y, nearClipPlane). The result is a preliminary 3D coordinate that looks something like (world.x, world.y, nearClipPlane.z). A great part of this function is that the camera didn’t have to be active in order for it to work, so I had this function running across multiple cameras at the same time.
My step after this was to shoot a raycast from the camera in the direction of the preliminary 3d point and if it hit the ground plane, that was the final 3D coordinate.
The issue I’m having in babylon is getting that preliminary 3D point. How to I go from screen coordinates to a 3d coordinate on an imaginary plane that sits in front of the camera? And how do I do this from a camera that isn’t active?