createTransform function

Create transformation matrices