Pointer position over mesh

#1

Hi, I’m working on a project where users select an item from an inventory and place it on a mesh (table), I want to help the user know where the item will be placed on the mesh before clicking and place the item. I’d need a way to know the point where I’m hovering over the mesh so I can temporarily show a place holder like a mesh and if they like the position, they perform a click and put the item on the mesh.

Any recommendations how to achieve this feature?

Thanks

Rafael

0 Likes

#2

Hey @rgalindox -

This PG should give you enough code to use in your scene. Courtesy of @RaananW and @Wingnut.

https://www.babylonjs-playground.com/#2C8LVE#13

There are a few methods available to accomplish what you seek in BJS; but I believe making use of the normals on your target mesh is the simplest and most versatile. And this is something everybody uses for multiple purposes… so learn this and keep it in your memory palace.

Galen

3 Likes

About pointer and meshes
#3

Thank you very much. I’ll check it out right away.

Best regards

0 Likes

#4

Thank you, I was able to achieve the feature I was looking for.

Thank you!

1 Like