The recently reported wobbling bands in 135 Pr are investigated by the collective Hamiltonian, in which the collective parameters, including the collective potential and the mass parameter, are respectively determined from the tilted axis cranking (TAC) model and the harmonic frozen alignment (HFA) formula. It is shown that the experimental energy spectra of both yrast and wobbling bands are well reproduced by the collective Hamiltonian. It is confirmed that the wobbling mode in 135 Pr changes from transverse to longitudinal with the rotational frequency. The mechanism of this transition is revealed by analyzing the effective moments of inertia of the three principal axes, and the corresponding variation trend of the wobbling frequency is determined by the softness and shapes of the collective potential.