Generating a heightmap 2004-02-24 - By Ian Thomas
Back Barry,
> Best bet for simple inclusion is probably bounding sphere > checks, then there's simply no way for it but to check > vertices. All you can hope to do is narrow down as quickly as > possible. Even then it's non-trivial though, assuming you > want the absolute highest point. I'd probably not do that, > and stick to the highest (nearest) vertex in a tile. I say > 'nearest' because as you rightly point out, if objects cross > tile boundaries you end up with some interesting scenarios.
Unfortunately nearest boundary doesn't quite work well enough for me... this is for pathfinding, and, amongst other things, includes ramps and stairs. It matters a great deal whether the slope of the heights of tiles that the ramp crosses is correct. (Again, just a #box primitive, but rotated in the x axis to make a ramp), because otherwise my pathfinder goes 'nope, too much of a height difference there' and won't let you go up the stairs.
> You can do it at differing detail / accuracy levels: > - A fully fledged edge / line intersection with your tile boundaries > - Simplified version of above that simply takes highest > vertex in tile or along edge that crosses boundaries > - Very simply 'if object is in tile then take it's highest > point regardless' > - Even simpler bounding sphere (for max height)
> If you have a heightmapped terrain (not sure - you simply > said it was an infinite plane) then you can't use bounding > sphere for that particular scenario, but then again a > heightmapped terrain already lends itself to much simpler > height checks so no problems there.
Nope, this is just an arbitrarily-sized room (within the 240x240) with a bunch of objects scattered around it.
Thanks anyway - like I said, I think maybe the additive version might be the best bet, if only to spread the apparent cost of calculation. :)
Cheers, Ian
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|