Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

input and output of the working algorithm in 2d

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.

share|improve this question

1 Answer 1

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.

Note: For this approach you need a grid of points.

share|improve this answer
    
Thanks for your answer. Unfortunately there is no constant grid of points. I added additional information at the end of my question. –  danijar Mar 18 '13 at 18:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.