How to compute the surface height based on normal vectors

dilloncyh
Messages
39
Reaction score
0
Suppose I have already found the surface normal vectors to a set of points (x,y), how do I compute the surface height z(x,y)?

Basically what I have are the normal vectors at each point (x,y) on a square grid. Then I calculate the vectors u = (x+1,y,z(x+1,y)) - (x,y,z(x,y)) and v = (x,y+1,z(x,y+1)) - (x,y,z(x,y)), and use the facts that u and v are both orthogonal to the the normal vector at (x,y) to obtain a system of linear-equations which can be solved by using standard linear algebra. The problem is that since there are many points on the grid (the number of pixel on a 200x300 image), this system of equations is very very large, and the computational time is very slow. So I wonder if there are other methods to compute the surface height z(x,y) from the given set of normal vectors.

thanks
 
Physics news on Phys.org
If you integrate along one axis (let's say x), the derivative of z with respect to x should be a simple function of your normal vector components.
You can get to every point with two one-dimensional integrations. Not sure about the numeric stability of that approach, but that is easy to check with real examples.
You can also transform your system and make just one-dimensional integrals but then the discrete spacing of the points could get ugly.
 
Back
Top