Re: [Algorithms] Modifying the min and max altitude in a heightmap
Brought to you by:
vexxed72
From: Thatcher U. <tu...@tu...> - 2000-08-01 18:19:33
|
From: Allan Bentham <A.B...@Re...> To: <gda...@li...> Sent: Tuesday, August 01, 2000 7:19 AM Subject: Re: [Algorithms] Modifying the min and max altitude in a heightmap > Why not have a lower resolution height map that simply contains the values > of the max and min height 'hiexels' in that particular cell? > > That way you can more easily reject a large (depending of course on your > chosen resolution) number of 'heixels'. > > You'll still have to do a complete scan of your low res map but it will be > faster than goin through the individual 'hiexel' map. If you take that idea to its logical extreme (i.e. give the lower-res bitmap its own even-lower-res min/max map, etc), you end up with a hierarchy of maps. The mighty quadtree is an example of such a hierarchy, and it crushes this problem. A "linear" quadtree is probably what you want, and probably not to the full resolution of the original heightfield, to keep the memory costs down. Check the list archives and/or the web for copious info. -- Thatcher Ulrich http://tulrich.com > > Sam McGrath wrote: > > > > > This may have a simple solution, but I haven't thought of one yet... > > > > > > I have a heightmap of altitude values. The heightmap is subject to > > > modification during the course of my program. When I load the heightmap > I > > > compute the maximum and minimum values (altitudes). During the program, > > if > > > a value in heightmap that is modified goes beyond the maximum altitude, > I > > > assign that value to the maximum altitude (and similarly for the minimum > > > altitude). > > > > > > However, I also want to be able to tell if the maximum value has > _shrunk_ > > > (or if this minimum value has increased). So far I can't think of a > > simple > > > way to do this other than rescanning the whole heightmap whenever a > value > > is > > > modified, and clearly this is not a practical solution. > > > > > > Hopefully there's a nice simple method that I'm blind to, so please > > > enlighten me if you can. (-: |