Each dot's 3D coordinates (x, y, z) come from converting latitude and longitude with the standard spherical-to-Cartesian formula. Multiplying every dot by a y-axis rotation matrix each frame makes the whole sphere appear to spin.
Depth comes from two tricks. Dots closer to the camera (a larger z) are drawn bigger and more opaque, while distant ones shrink and fade — near things large, far things faint. And sorting the dots by z each frame, drawing the back ones first and the front ones last, makes nearer dots naturally occlude the ones behind them (the painter's algorithm).
You could build this with an actual three.js Points geometry, but at a few hundred dots, doing the maths directly on a 2D canvas — as this demo does — is much lighter. One detail that matters: the number of dots per latitude ring should scale with the cosine of that latitude, or dots visibly bunch up near the poles.
When to use
Use for a global-reach section or a "connections worldwide" stat backdrop. More dots cost more CPU — for a card-sized area, keep the count under a few hundred.