Fix calculation of transformed bounds not using inverse matrix
This commit is contained in:
parent
c932f2aa30
commit
010fea7df8
@ -23,6 +23,8 @@ def boundsCorners(bounds):
|
|||||||
return list(corners)
|
return list(corners)
|
||||||
|
|
||||||
def transformBounds(bounds, matrix):
|
def transformBounds(bounds, matrix):
|
||||||
|
# matrix goes from dest to source; we need source to dest here, so get inverse
|
||||||
|
matrix = np.linalg.inv(matrix)
|
||||||
corners = np.array(boundsCorners(bounds))
|
corners = np.array(boundsCorners(bounds))
|
||||||
corners = np.hstack([corners, ([1],)*8])
|
corners = np.hstack([corners, ([1],)*8])
|
||||||
corners = corners * matrix
|
corners = corners * matrix
|
||||||
|
Reference in New Issue
Block a user