# How to combine bezier curves to a surface?

My aim is to smooth the terrain in a video game. Therefore I contrived an algorithm that makes use of bezier curves of different orders. But this algorithm is defined in a two dimensional space for now.

To shift it into the third dimension I need to somehow combine the bezier curves. Given two curves in each two dimensions, how can I combine them to build a surface?

I thought about something like a curve of a curve. Or maybe I could multiply them somehow. How can I combine them to cause the wanted behavior? Is there a common approach?

In the image you can see the input, on the left, and the output, on the right, of the algorithm that works in a two dimensional space. For the real application there is a three dimensional input.

The algorithm relays only on the adjacent tiles. Given these it will define the control points of the mentioned bezier curve. Additionally it marks one side of the curve as inside the terrain and the other as outside.

-

You can define a bezier-area by $$x(\lambda,\mu) = \sum^m_{i=0}\sum^n_{j=0}B_{im}(\lambda)B_{jn}(\mu)p_{ij}$$
with $\lambda,\mu\in[0,1]$, $B_{im}$ are the Bernstein polynomials and $p_{ij}$ are the given points.