meshcat-dev / meshcat-python

WebGL-based 3D visualizer for Python
MIT License
247 stars 60 forks source link

Object picking #26

Open jorgehatccrma opened 5 years ago

jorgehatccrma commented 5 years ago

Hi, I haven't been able to figure out if it's possible to implement object picking (using the mouse). I know that three.js does support mouse picking (e.g. https://threejs.org/docs/#api/en/core/Raycaster) but it's not clear to me how to capture such events on the client (in my case python) side. Is that possible with the current code base? If not, are there plans to implement it?

rdeits commented 5 years ago

You're right--it's something that is possible in three.js but there's no interface for it in meshcat (neither in the JavaScript front end nor in the Python interface).

So far, I've been focusing on having a very small set of features with a clean interface, so while I think 3d object picking is really useful in many cases, it hasn't been something I wanted to support. That may change eventually, of course.

In the meantime, you might want to check out Director: https://github.com/RobotLocomotion/director which I've used extensively in the past. I created MeshCat because I wanted a really lightweight 3d viewer, but if what you want is a rich way to interact with 3d scenes then Director is pretty great.

jorgehatccrma commented 5 years ago

Thanks for your reply. I'll take a look at director.

On Tue, Oct 2, 2018 at 2:42 PM Robin Deits notifications@github.com wrote:

You're right--it's something that is possible in three.js but there's no interface for it in meshcat (neither in the JavaScript front end nor in the Python interface).

So far, I've been focusing on having a very small set of features with a clean interface, so while I think 3d object picking is really useful in many cases, it hasn't been something I wanted to support. That may change eventually, of course.

In the meantime, you might want to check out Director: https://github.com/RobotLocomotion/director which I've used extensively in the past. I created MeshCat because I wanted a really lightweight 3d viewer, but if what you want is a rich way to interact with 3d scenes then Director is pretty great.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rdeits/meshcat-python/issues/26#issuecomment-426440531, or mute the thread https://github.com/notifications/unsubscribe-auth/ABc6rDAQjF88S2OprKf9Bs0ke6bbp_QNks5ug92jgaJpZM4XDAHI .

-- Jorge Herrera, Ph.D.c. CCRMA (Center for Computer Research in Music and Acoustics) Stanford University

kaanaksit commented 4 years ago

@jorgehatccrma what did you end up using long last?