Hey,
I reckon your best bet would be to break it down into a grid before
trying to interpolate anything. I'm not sure how precise or efficient
you need it to be, but maybe snap the rectangles to the grid? You could
even work out what percent of each cell in the grid is filled by a
particular rectangle and assign it's value accordingly. For example: if
there's are rectangle with a value of 40 that covers have of a cell
that cells value would be 20 (40*0.5).
If you need some info on interpolation in 2D I found this page useful:
http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
I did this in Flash based off info in that page:
http://www.particlesystem.com/lab/perlin_colours/
Hope that helps,
Haydn.
On 19/12/2006, at 6:26 PM, Andreas R wrote:
I am trying to build an application that produces a 2d "heat map".
Ideally the dataset would be populated by objects such as this:
{id:0, x:0,y:0,rectangle:Rectangle,value:100} where value is between 0
(cold) and 100 (hot).
These objects would represent "points of interest" on another surface,
such as a map of a city to map out population count or other
statistics.
My problem is, given that one object is a small rectangle far up left,
and another is a wide rectangle at the very bottom, how would i
interpolate colors between these positions?
I'm fully aware that this is far beyond what i've done before with
colors or even interpolation et al. Any ideas would be grand, because
i'm feeling blank at the moment :(
- Andreas
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com