Re: [Algorithms] Maximum Distance Point To AABB
Brought to you by:
vexxed72
From: Tom H. <to...@3d...> - 2000-08-01 06:33:44
|
At 11:42 PM 7/31/2000 +0200, you wrote: >Hi, > >For my terrain engine texture synthesizer, I want to dynamically load the >mipmap levels only when they are needed and delete them when they are not >needed anymore. >The terrain is subdivided into little chunks which all have their own >texture. So I would like to find out the minimum and maximum Distance from a >point to the AABB enclosing the terrain chunk. > >The minimum distance was easy, but how do I get the maximum distance to the >AABB? If you know which corner of the AABB is the minimum, then the maximum is the corner farthest from that corner. If the nearest point is the lower left, then the farthest point always the upper right. You should be able to figure out the actual distance pretty easily. Of course depending on the type of checks your doing to find the minimum, you should be able to reverse the sense of the tests and get the maximum instead. Tom |