Quote Originally Posted by Clootie
If "ball" size is comparable to "pixel" size then you can just take 4 pixels surrounding ball and calculate gradients from them.
For example: ....

<--- clip --->
Clootie my man. Once again you kicked me to the right direction. After hours and hours of studying Pythagoras and Newtons laws I finally managed to do what I wanted to. Thank you very much (once again ).

Here's little sample I made. It doesn't have any fancy graphics and it's very unoptimized and very rude. It uses combined Win32API and Delphi VCL for graphics and math. It also loads height map from the bitmap file but hey, it's finally working (kind of).

http://koti.mbnet.fi/fwolf/misc/roll-on.zip Size ~300KB

It's zipped with the folder, so just unzip it to the root where you want it to and it will make the folder for you.

Edit: By the way. One can modify the bitmap anyway one wants to. Just keep it grayscaled and it will be fine.