Terrain Height

I'm trying to make an RTS camera control system. So far, the movement and rotation all works fine. I have a Vector3f location that I place the camera in relation to (cam.getDirection() times a float distance, which I increase and decrease for scrolling).



In my simpleGame class, I'm trying to set the location variable to the terrain's height, so the camera follows the terrain. For some reason, it isn't working - does anyone have any idea why?

ever looked a this RTS camera/controll framework:

http://www.jmonkeyengine.com/jmeforum/index.php?topic=5365.0

cam.getLocation().y = page.getHeightFromWorld(cam.getLocation()) + 10f



That would position your camera 10 units above the height of the land at the specific point. That way you flow in/out of valleys/mountains and you'll always be the same distance from the ground.

EDIT: That is if you use TerrainPage, of course.