Ground-state properties of bosons in three- and two-dimensional traps