From: Evan M. C. <le...@ca...> - 2000-04-14 14:01:55
|
Aaron Joen wrote: > How about trying this, > > before you render the map, scale up the size of your polygons by a factor > large enough such that it will be displayed, you will know the size to scale > from the smallest value in your dataset... > > Aaron Thanks for the suggestion. In my application I have to render terrain data from a radar simulation. The data from the radar is continually dumped into a 2d array of return values. This 2d array of values is used to shade a set of polygons that are of fixed shape. The smallest being within the first 10% or so of the apex of the radial scan. Regardless of the range of terrain I'm presenting all the polygons have a fixed relation to the size of the window (I.E. the number of elements in a row to the number of pixels horizontally or vertically across the drawing area). My ortho projection changes with the range of the radar's data (in feet) and the polygons are scaled to fit the resultant ortho projection. Bottom line is whether I'm rendering 40, 80, or 160 nm of return data the same set of polygons close to the apex of the scan will always be used and they will always be small and they must always be drawn. I've been playing with the predicate (area * area < .0025): a (area * area <= 0) embarrassingly incorrect; won't ever be negative...dooh b (area <= 0 ) not good; after thinking about it it becomes obvious why it was being squared...duh c (area * area < .0001) not enough d (area == 0) works fine for my combination of OS and hardware but there is the nagging concern about dividing by a very small number. e (area * area < .000000001) this value was not found experimentally, just picked; it seems to work so I'll stick with it for now. Since "d" wasn't giving me problems I'm sure e won't either. Anyway, for the record "d" works on my Linux v2.2.12 box (and a v2.0.36 box for that matter). I've nominated "a" for Steve Baker's "Cruel Code" page but he hasn't replied yet. Admittedly it isn't in any official piece of released code. Only my edited copy of one and only for a short time. Thanks for the help guys, -- // Evan M. Carey Camber Corp. // ev...@ca... 4885 Alpha Road, Suite 110 // 972-991-5322 x145 Dallas, TX 75244-4633 // 972-991-5352 fax. www.cambertx.com |