Fitting a 3d point cloud with a polynomial surface

I have 3D point cloud and I would like to fit a polynomial surface to it. Could anybody please explain the step by step process to that.

Thanks a lot.

-
In what, the least squares sense? Do you have any idea on what your model polynomial would look like? – J. M. Jul 24 '12 at 10:13
yup in the least square sense. The model could be anything which minimizes the distance of points to the surface. But the least complex model is definitely preferred. Is there a way to determine the model complexity depending on the data? – Shan Jul 24 '12 at 10:16
So, you have no idea if it could be a quadratic, a cubic, or some higher-degree polynomial? – J. M. Jul 24 '12 at 10:17
yup, not at the moment. I can try different variants to see what fits. But I am not clear with the process it is easy to conceptualize in 2D but in 3D and with a surface its a bit weird to me. – Shan Jul 24 '12 at 10:20
It's easier to do what is called stepwise regression in two dimensions, yes. I don't know how that can be modified in the three-dimensional case, where for instance the quadratic terms to choose from are $x^2$, $y^2$, and $xy$ (and even more choices for higher-degree terms). Anyway, I've told you a term you can search on the Internet... – J. M. Jul 24 '12 at 10:22