buildTmat function

Build/Get transformation matrices