1

I am trying to reproduce the heatmap effect Bungie uses to show kills/deaths on specific halo 3 maps using PHP and GD. (Example: http://www.bungie.net/stats/halo3/heatmapstats.aspx?player=gatts007 - pick a map like "Guardian" for a better example.)

I have all the data and background map images from my game, but I am having trouble coming up with a way to actually get the gradient to work correctly.

Here is my process so far:

  1. On a pure black background: For each kill Draw white gradient-translucent circle (solid near the middle, 100% translucent at the edge) at that location on the map. (This is working well.)
  2. Now replace any solid black pixel with a pure translucent pixel.
  3. Map a color scale to the remaining pixels to get the heat map effect. (Use gray scale value to map to a color.)
  4. Place this created image on top of the real map background.

I am having problems with steps 2 and 3. Does anyone have some good examples of these steps? Or better yet, a process that will give better results?

Thanks!

EToreo
  • 2,936
  • 4
  • 30
  • 36

1 Answers1

2

Maybe this class could help: http://www.labsmedia.com/clickheat/heatmap.html

You can also try Heat map API: http://www.heatmapapi.com/

dusoft
  • 11,289
  • 5
  • 38
  • 44
  • 1
    Thanks, I have looked at both of these and they are not what I need. I am looking for a 100% home-brew solution with just PHP and GD so I can use it in a commercial setting. – EToreo Nov 24 '09 at 00:38
  • Whats wrong with using Labsmedia's Heatmap class in a commercial project, as long as you keep the GPL info in their class? – fresskoma Nov 24 '09 at 01:02
  • 1
    then make yourself home-brew solution based on the studying code of both. – dusoft Nov 24 '09 at 10:01