Smoothing

I have created a terrain, it loads from a simple RAW file. The porblem is that I am getting straight lines going from one vertex to the other. I want it to smooth out so:
Instead of this:
_/
_/
/
I get this:
/
/
/
Or in a case like this:

_______/
/
I want it to be rounded and go from the first vertex to the last in sort of like a rounded slope.

I would be fine with the first way, as I know it would be easier, but I would prefer a way to round the slopes.

I don’t want any “sharp edges”.

How can I achieve this? I have thought of subdividing the triangles in my strip(although I don’t know how to do this) and I have thought of a bezier surface instead of a triangle strip(don’t know how these work either).

To smooth surfaces I personnaly really like Catmull-Clark subdivisions surfaces. Simple to implement and works with any topology.
http://symbolcraft.com/graphics/subdivision/

There is a lot of other way to smooth surfaces (bezier, spline, nurbs, …) it all depends on what your want : surface passing through control points, very smooth surface, locality, etc…

Is you terrain a regular grid ?

I believe it is a regular grid.

The Catmull-Clark method looks like it would be perfect, but how would I implement it into my code? It gives no code to go by, not even some psuedo-code. I get the theory behind it, but implementing it would be a different matter. One problem I see with it though, is that I am making large terrains. I have them in display lists, and are getting 60 frames per second max, this is generating more triangles and that is not something I want, I acctually want less. I guess I will have to look more into LOD before I do something like this.

Anyway, any help would be apprectiated.

The Catmull-Clark method looks like it would be perfect, but how would I implement it into my code? It gives no code to go by, not even some psuedo-code.
www.google.com

There many websites dedicated to this stuff, not to mention several full blown implementations…

I have tried googling that stuff, and I am getting absolutely nothing.

I am going to try bezier surfaces and maybe nurbs.

But before I go into that, I want to know how I would add a vertex at a point between 2 other vertices. I am reading all my current vertices from an array: map[768][768]; and was just wondering how I could call them with others inbetween, so between map[1][1] and map[2][2] I work out the average, which is 1.5, and then add a vertex at the point (1.5, map[1][1] + 0.5, 1.5)

I am using triangle strips and calling it through a display list.

I have tried googling that stuff, and I am getting absolutely nothing.
You need to press enter after you type in the search phrase…

Haha, very funny.

Anyone with a serious answer, the only things I am finding in google are in other languages or just talk about the theory behind the catmull clark method.

  • We don’t even know which programming langage you use
  • The catmull clark is one of the simplest subdivision algorithm

took me 4 seconds :
http://www.multires.caltech.edu/pubs/fastsubd.pdf
http://en.wikipedia.org/wiki/Subdivision_surface
http://www.math.hu-berlin.de/~hakenber/subdiv/ccds.htm

EDIT: ok I am in a good mood today :
http://www.cs.rice.edu/~sschaefe/research/tutorial.pdf

Oh, lol, I use C++.

ZbuffeR, I don’t even get them in my google searches :frowning: