added a method to tranform a cube to a boundingbox