Hey. Since you prolly wanna stay with the books code, take a look at chapter 20''s source code. Theres a function called GetHeight(). With a little editing you can get it to work with a heightmap and stuff (like replacing terrMult with MAP_SCALE and so on).
"Insane people are always sure that they are fine. It is only the sane people who are willing to admit that they are crazy."