We developed a compact polarization-mode converter for microscopy to control three-dimensional polarization at the focus. The converter consisted of two homogeneously aligned liquid-crystal spatial light modulators with eight independently controllable electrodes (segments), and a quarter-waveplate. The converter converted a linearly polarized beam to three polarization modes: two orthogonal linear polarizations and a pseudo-radial polarization. We applied the converter to second-harmonic-generation microscopy and demonstrated the detection of three-dimensional molecular orientation.