Measurements of the longitudinal and lateral development of electromagnetic cascades in lead, copper and aluminum at 6 GeV