glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[glob2-devel] Minimap algorithm


From: Bradley Arsenault
Subject: [glob2-devel] Minimap algorithm
Date: Fri, 13 Jul 2007 13:04:52 -0400

I've been trying to recreate minimap code in its own class with sort of half/success. My algorithm bassically assigns a colorType to every point on the map, (colorType is just a smaller memory footprint used to reference the color itself), and then interpolates between these values. The minimap is only 100x100, but maps are 64x64 or 128x128 so they don't line up. So I bassically I just interpolated between values, casting the 128 to 100. Some pixels will lie close to a point on the map, others will be half way inbetween two points, so the values are interpolated (in 2 dimensions) for every pixel.

The algorithm works, and I did various optimizations on it, so it doesn't use very much CPU (less than the last one did). However, the algorithm doesn't produce as nice as a minimap as the old one. Specifically, it doesn't create the nice, curved terrain, instead, (thanks to the interpolated), the terrain edge seems like a sort of blurred conglomerate. I tried instead mapping a pixel to its closest map point (no interpolation), but that was far worse.

As far as I can tell, the old minimap averaged between the colors of points of terrain, rather than interpolating. If anyone has the details on how this works, it would be greatly apprecciatted.

--
Really. I'm not lieing. Bradley Arsenault.
reply via email to

[Prev in Thread] Current Thread [Next in Thread]