The transition from two-dimensional to three-dimensional planforms in infinite-Prandtl-number thermal convection