Dragging balls on top of a mesh. There are two parts to this: using a widget with a vtkSphereHandleRepresentation, and using a manipulator to figure out where to put the sphere.
Using a widget (example: vtkPolyLineWidget) can get you placing and selecting spheres in an efficient manner. Internally, widget handles are picked using a fast color buffer.
Constraining a ball to the surface of a mesh will entail a custom widget manipulator. Manipulators translate 2D coordinates into an appropriate 3D coordinate (e.g. the PlaneManipulator keeps points on a plane). What you want is a manipulator that finds the first actor that intersects with the mouse position. This roughly looks like the following approach:
use displayToWorld to convert 2D mouse coords to a point in 3D
create a ray starting from the camera position to the 3D coord from step 1
use a vtk.js picker to intersect with geometry. If there is an intersection, get the coords and use that as the new position of the point.
math on the mesh: we do not provide those operations, though if the VTK C++ library does then we have a path for porting. (e.g. there is the vtkCollisionDetectionFilter in VTK C++, but not yet in vtk.js…)