Scala version of the distance renderer