Re: Runtime generation of contour lines
Brian Cabral (cabral++at++sgi.com)
Fri, 30 Oct 1998 08:37:31 -0800
> Date: Fri, 30 Oct 1998 10:16:30 -0600 (CST)
> From: Steve Baker <sbaker++at++link.com>
>
> On Fri, 30 Oct 1998, Gamble, Murray - Kan AV wrote:
>
> > Does anybody have any ideas as to how I might generate contour lines at
> > runtime from an exiting terrain model? I have several .flt terrain
> > models that represent non-real-world geography and would like to generate
> > a God's-eye-view model made up of contours for the terrain databases.
>
> Depends how much quality you need but one very quick 'cheat' is to
> use a TexGen to splat a texture map made up of horizontal stripes
> onto the terrain using an X/Z plane projection.
>
> If you make the map too low in resolution - and/or if a contour line
> happens to go through a very gently sloping area - then the contour
> lines get very wide and fuzzy - but then I did say this was a quick
> cheat.
>
> Failing that - you really have to go through each polygon in the
> scene computing the intersection with contour 'planes' that lie
> parallel to the ground - then insert lines at the appropriate points.
>
> I've done it - but it's too complicated to go into in detail.
>
> If the texture approach is adequate for your needs, you can probably
> get it going in a dozen lines of code. Do a 'man' on pfTexGen and
> all will be clear.
>
Two quick comments on this. If you use a 1-D texture that is very
high res and the plane texgen Steve suggested you might get around
some of the blurring problems.
The other observation is that you can use a multi-pass algorithm which
uses clipping planes and edge extraction to build up an image of
contours which then can be composited over the terrain image.
B.c.
This archive was generated by hypermail 2.0b2
on Fri Oct 30 1998 - 08:41:47 PST