We propose a simple method for computing the single-particle eigenfunctions in nanostructures with three-dimensional confinement. The proposed procedure transfers the problem to the momentum space, solves an eigenvalue equation on a reduced wavevectors space and then transfers the solution back to the real space. We show that in such a way it is possible to obtain the eigenvectors and eigenvalues corresponding to lower energies with significant improvement in computing time and memory requirements with respect to numerical methods in the coordinate space. The method can be applied to structures with inhomogeneous effective mass and can easily include the full band structure. We have tested the code on typical confining potentials of nanostructures, in order to show the advantages and possible limitations of the proposed method.