Otto Jensen wrote:
> The question is if this is something that will allways occure with
midpoint
> displacement, or if I am getting it all wrong. An example can be seen at
> www.greenleaf.dk/ridges.JPG where I made the situation more extreme to
> clearly show the problem.
It will always occur if you choose random or otherwise arbitrary height
displacement of the subdivision points.
What you may want to investigate doing (assuming the origin is in the
center of your planet) is push points out to be the same distance from
the origin. E.g. choose your radius, and at each subdivision push the
new point so that it's that far away from the origin.
> Given two points A and B, I calculate a linear midpoint M as (A+B)/2,
> and then move it outwards to a position which is at the average radius,
> so that (|A|+|B|)/2=|M|*s=|M'|.. where s is some scaling.
If you want to generate a sphere, s = desiredRadius / |M|, and scale M
by that amount. The magnitudes of A and B are irrelevant, although your
scale factor is trigonometrically related to the angle between A and B
(which you could get with the dot product), but that seems like the hard
way to do it to me. ;)
You may want to put something in place to generate mountains and other
terrain features, but getting a perfect sphere first is probably best.
;)
Good luck,
-tom!
--


|