The spatial orientation of fringes has been demonstrated to be a key point in reliable phase demodulation from a single n-dimensional fringe pattern, regardless of the frequency spectrum of the signal. Recent publications have shown a general method for determination of the orientation factor by use of a regularized phase-tracking ͑RPT͒ algorithm. We propose a generalization of a RPT algorithm for estimation of the spatial orientation in a general n-dimensional case. The proposed algorithm makes use of a simplified cost function that remains one dimensional regardless of the dimension of the problem. This makes the calculation faster than with a standard RPT algorithm, with which it is necessary to minimize an n ϩ 1-dimensional cost function for each point of the sample space. We have applied the method to the three-dimensional demodulation of a time-evolving fringe pattern, with good results.