Perhaps you can use something like this: I took the points in the GraphisComplex
and made an additional set of Point
s representing the vertices in Yellow
. The points are extracted and then put back by means of a replacement rule:
data = ExampleData[{"Geometry3D", "StanfordBunny"},
"VertexData"];
bunny =
ListSurfacePlot3D[data, MaxPlotPoints -> 50, Boxed -> False,
Axes -> None, Mesh -> False, PlotStyle -> Brown];
Print@Show[
bunny /. g_GraphicsComplex :>
GraphicsComplex[g[[1]],
Join[g[[2]], {Opacity[0.5], Yellow, PointSize[.01],
Tooltip[Point[#], #] & /@ Range[Length[g[[1]]]]}]],
ImageSize -> 500
]

You can still use the mouse to drag and rotate the object, but when you hover over a vertex (which sticks out of the surface as a yellow object), the index of that point in the GraphicsComplex
is displayed as a Tooltip
. I thought this is better than making the vertices clickable because that interferes with the 3D rotation.
The extra Print
in front of the Show
is needed in order to suppress a warning triggered by the large size of the Graphics3D
output.
Edit
If you want something that respons to mouse clicks in a useful way, it's straightforward to combine the above approach with another answer where I showed a way to convert Tooltip
into Button
objects. If you then use the toolSpoolRule
from that answer, you can get a permanent record of the vertices that you have clicked, in the form of a List
on the Clipboard
which can be pasted anywhere you want.
Here I repeat the only additional definition we need:
toolSpoolRule =
Tooltip[t__] :>
Button[Tooltip[t],
CopyToClipboard[
First@Append[
Cases[NotebookGet[ClipboardNotebook[]],
TooltipBox[x_, "\"Clicked Points\"", ___] :>
Tooltip[Append[ToExpression[x], Last[{t}]],
"Clicked Points"], Infinity],
Tooltip[{Last[{t}]}, "Clicked Points"]]]];
Now replace the plot command by the following:
Print[
Show[bunny /.
g_GraphicsComplex :>
GraphicsComplex[g[[1]],
Join[g[[2]], {Opacity[0.5], Yellow, PointSize[.01],
Tooltip[Point[#], #] & /@ Range[Length[g[[1]]]]}]],
ImageSize -> 500] /. toolSpoolRule
]
You get visually the same output, but when you see a Tooltip
appearing near a vertex that you hover on, you can now click the mouse to add the vertex index to the clipboard. When you're done, press the paste keys and you get a list of the clicked vertices.