A novel semidiscrete Peierls-Nabarro model is introduced which can be used to study dislocation spreading at more than one slip planes, such as dislocation cross-slip and junctions. The strength of the model, when combined with ab initio calculations for the energetics, is that it produces essentially an atomistic simulation for dislocation core properties without suffering from the uncertainties associated with empirical potentials. Therefore, this method is particularly useful in providing insight into alloy design when empirical potentials are not available or not reliable for such multi-element systems. As an example, we study dislocation cross-slip and constriction process in two contrasting fcc metals, Al and Ag. We find that the screw dislocation in Al can cross-slip spontaneously in contrast with that in Ag, where the screw dislocation splits into two partials, which cannot cross-slip without first being constricted. The response of the dislocation to an external stress is examined in detail. The dislocation constriction energy and the critical stress for cross-slip are determined, and from the latter, we estimate the cross-slip energy barrier for straight screw dislocations.