Plash #1 .. Possibly blitzmax minib3d code, looks like it would work with b3d just how it is, except for the fact you have given us partial code to look at. Is terrainy a standard function? please post more info and code so we can help you out.