The characteristics of whispering-gallery modes (WGMs) in 3-D cylindrical, square, and triangular microcavities with vertical optical confinement of semiconductors are numerically investigated by the finite-difference time-domain (FDTD) technique. For a microcylinder with a vertical refractive index 3.17/3.4/3.17 and a center layer thickness 0.2 mum, Q-factors of transverse electric (TE) WGMs around wavelength 1550 nm are smaller than 103, as the radius R < 4 mum and reach the orders of 104 and 106 as R = 5 and 6 mum, respectively. However, the Q-factor of transverse magnetic (TM) WGMs at wavelength 1.659 mum reaches 7.5 times 105 as R = 1 mum. The mode coupling between the WGMs and vertical radiation modes in the cladding layer results in vertical radiation loss for the WGMs. In the microcylinder, the mode wavelength of TM WGM is larger than the cutoff wavelength of the vertical radiation mode with the same mode numbers, so TM WGMs cannot couple with the vertical radiation mode and have high Q -factor. In contrast, TE WGMs can couple with the corresponding vertical radiation mode in the 3-D microcylinder as R < 5 mum. However, the mode wavelength of the TE WGM approaches (is larger than) the cutoff wavelength of the corresponding radiation modes at R = 5 mum (6 mum), so TE WGMs have high Q-factors in such microcylinders too. The results show that a critical lateral size is required for obtaining high Q-factor TE WGMs in the 3-D microcylinder. For 3-D square and triangular microcavities, we also find that the Q-factor of TM WGM is larger than that of TE WGM.