enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.3k stars 285 forks source link

Picker for the case of multiple points3d objects #1229

Open srk opened 1 year ago

srk commented 1 year ago

Hello, Following the official examples and want to be able to extract the x,y,z coordinates of a clicked sphere glyph made by points3d() in a 3-D scene. Where my application differs is that I have multiple (indeed, a Python list) of mlab.points3d objects. The standard example allows for identifying the index number of a particular sphere in a single points3d object. Do I need separate pickers defined for each points3d() object? How would I control which picker gets triggered?

srk commented 1 year ago

I can look at the picker.actor on a picked sphere, and it seems to have a unique value of vtkOpenGLActor. So then presumably I have to scan through all the members of:

scene.mayavi_scene.children

and find any values of vtkOpenGLActor that match the picked one. How can this be done?