mikedh / trimesh

Python library for loading and using triangular meshes.
https://trimesh.org
MIT License
2.97k stars 576 forks source link

Converting 2D coordinate (mouse click) to 3d coordinate (with predefined Z) #1584

Open MorielTurjeman opened 2 years ago

MorielTurjeman commented 2 years ago

I'm trying to create a small application where a the mouse cursor projects a ray into the screen and find where it intersects with some object on the screen.

But I can't find a way to translate the the mouse into a ray in the 3d world.

I've tried using the 3d camera rays, but with no luck, or perhaps i've used it wrong.

How could that be achieved ?

benmor20 commented 7 months ago

Hi @MorielTurjeman - I'm trying to solve a similar problem and I think I am running into the same issue. It seems that scene.camera_rays() is not giving the right values. Have you managed to solve this problem?