I have a terrain made of a heightmap and a md2 character that walks on the terrain. I get the height of the terrain and set this as the y value of the character.
(ymodel = GetHeight(-zmodel , xmodel...