Shape which hugs terrain

I would like to draw a flat shape which hugs the terrain.  I know how to get height values from the height map, but I have no idea how to draw the shape with the different y values.  Any pointers in the right direction would be appreciated.

For what purpose is your shape? If it is meant to be a selection cursor or highlight of some sort, try searching for projected texture.

That is one way of doing what I want.  I will check it out.  This thread discusses what I am trying to do: http://www.jmonkeyengine.com/jmeforum/index.php?topic=4084.0