With the convert() function, you can get the height of the street shape�??s scope directly in world coordinates.
heightOverTerrain = convert(y,scope,world,pos,scope.sx*0.5,scope.sy*0.5,scope.sz*0.5)-elevation
( note the sx,sy,sz * 0.5 is the offset of the sampled point towards the center of the scope, thus the height sampled is calculated in the �??middle�??. )
of course, this is just a simplification.
�??elevation�?? is an attr which is derived from the terrain map layer.
Let me know if this already helps you further or need an example. convert() is quite complex and not easily to understand.