Re: Help me be lazy
- From: Mark Healey <die@xxxxxxxxxxx>
- Date: Sun, 21 May 2006 04:03:20 GMT
On Sat, 20 May 2006 00:37:26 -0700, dtalagrand wrote:
There are several possible alternatives depending on what exactly you want
(of course, you can also use any combination to achieve the desired
result). Are you aiming more for realism or "real-time" (fast generation)?
Speed, definitely speed.
Spectral synthesis is very popular, but looks a bit rocky/angular
(especially with linear interpolation). Using cubic interpolation
significantly improves the results. However, 1/f-like noise algorithms
(Spectral, Mpd) are a bit monotonous, so I generally use an additional
perturbation filter (moving random distance and direction from each group
of "cells", and interpolating). This also has the added benefit of giving
a more eroded feel.
A simple algorithm that you might find interesting is the "hill"
algorithm, which generates nice rolling hills (big surprise!). You first
pick a random point on the terrain and a random radius, and then displace
all the points in the sphere (the closer to the point, the larger the
displacement), repeating the point/radius selection as many times as you
want, and then normalizing the field.
That's pretty much what I went with ellipses instead of circles for the
bases of the mountains and cosinusoidaly sloped sides. It involves a lot
of slow trig functions but it's not too bad. I'm still having trouble
coming up with criteria as to when to stop. The function basically takes
3 parameters, the location of the map array, the X and Y dimensions. So
it could be as small as 20X20 and as large as 2000 X 2000. Any Ideas?
--
Mark Healey
marknews(at)healeyonline(dot)com
.
- References:
- Help me be lazy
- From: Mark Healey
- Re: Help me be lazy
- From: dtalagrand
- Help me be lazy
- Prev by Date: Re: Nanoscale fractal developed
- Next by Date: Chaoscope 0.3 released
- Previous by thread: Re: Help me be lazy
- Next by thread: Fractal Generator for the Mac?
- Index(es):
Relevant Pages
|