Fix transformation matrix creation process