The functionality to do this is already in max, you just need to use isolines to create your terrain object.