def translation_matrix(direction):
 M = numpy.identity(4)
 M[:3, 3] = direction[:3]
 return M

def translation_matrix ( direction ) : M = numpy . identity ( 4 ) M [ : 3 , 3 ] = direction [ : 3 ] return M
return matrix to translate by direction vector .