Quote Originally Posted by Rahakasvi
It's hard to explain (even harder with words). I would definitely do it with vectors. Try to do it first in 2d. So the heightmap is 1-D greyscale bitmap. And the ball is circle.

So if you have values 0 and value 128 (grey) you can easily calculate the vector between those coordinates (0,0) and (1,12

From the vector you can create supportvector (dunno if it is the right word) of the terrain.

Then you can determine movement vector by adding gravity vector and terrains supportvector together. With 3D, it is bit complicated math of course
Okey, I understand what you mean and I was pondering something similar, but still the main problem is wondering me and did not came clear with your post. Maybe if I try to ask same question with other words.

The background (height map) is 2D so there's only X and Y -axis. The color of the pixels tells how hight current point of the map is. If value is 255 then that's the highest point possible and color is white. If value is 0 then that's the lowest point and color is black.

So, if that ball is "standing" somewhere between the highest and the lowest areas (halfway of the hill I may say) then it should get going to the downhill. Toward to the black area. Okey so, I now that black area is there, but that ball doesn't. There should be somekind of pixel checking system which scans the nearby area and after we know which way to move we come to those vectors but before that we have to decide which way to start moving and those background pixels tells that. I just don't know how I could check those pixels and which pixels needs to be checked? I mean how far I should check from the ball and how "wide" the range of checking should be? And which kind checking algorithm should be to prevent eating too much CPU power. I think I should do somekind bounding box for the sphere and check pixels inside that and calculate somekind of average value of each scanline. Am I correct?

Or am I going entirely to the wrong direction with my theory? Should this be completely something else? :roll: