Esempio n. 1
0
 def to_translation_rotation(self): 
     tra = tr.translation_from_matrix(self.data)
     mat = self.data.copy()
     mat[0:3,3]=0
     try: 
         rot,axis,point = tr.rotation_from_matrix(mat)
     except ValueError: 
         #print "Not a rotation matrix. "
         return None, None, None
     return tra, rot, axis
Esempio n. 2
0
 def to_translation_rotation(self): 
     tra = tr.translation_from_matrix(self.data)
     mat = self.data.copy()
     mat[0:3,3]=0
     try: 
         rot,axis,point = tr.rotation_from_matrix(mat)
     except ValueError: 
         #print "Not a rotation matrix. "
         return None, None, None
     return tra, rot, axis
Esempio n. 3
0
 def to_translation_scale_rotation(self): 
     # FIXME
     mat = self.data.copy()
     tra  = tr.translation_from_matrix(mat)
     tra_mat = tr.translation_matrix(tra)
     mat = numpy.dot(numpy.linalg.inv(tra_mat), mat)
     factor, origin, direction = tr.scale_from_matrix(mat)
     scale_mat = tr.scale_matrix(factor, origin, direction)
     scale = numpy.diag(scale_mat) 
     mat = numpy.dot(numpy.linalg.inv(scale_mat), mat) 
     try: 
         rot,rot_axis,point = tr.rotation_from_matrix(mat) 
     except ValueError: 
         #print "Not a rotation matrix. "
         return None, None, None, None
     #print "Rotation axis: ",rot_axis
     return tra, scale, rot, rot_axis
Esempio n. 4
0
 def to_translation_scale_rotation(self): 
     # FIXME
     mat = self.data.copy()
     tra  = tr.translation_from_matrix(mat)
     tra_mat = tr.translation_matrix(tra)
     mat = numpy.dot(numpy.linalg.inv(tra_mat), mat)
     factor, origin, direction = tr.scale_from_matrix(mat)
     scale_mat = tr.scale_matrix(factor, origin, direction)
     scale = numpy.diag(scale_mat) 
     mat = numpy.dot(numpy.linalg.inv(scale_mat), mat) 
     try: 
         rot,rot_axis,point = tr.rotation_from_matrix(mat) 
     except ValueError: 
         #print "Not a rotation matrix. "
         return None, None, None, None
     #print "Rotation axis: ",rot_axis
     return tra, scale, rot, rot_axis
Esempio n. 5
0
 def to_quaternion_translation(self): 
     tra = tr.translation_from_matrix(self.data)
     qua = tr.quaternion_from_matrix(self.data)
     return qua, tra 
Esempio n. 6
0
 def to_quaternion_translation(self): 
     tra = tr.translation_from_matrix(self.data)
     qua = tr.quaternion_from_matrix(self.data)
     return qua, tra