Transform the points by the inverse of the projection matrix, *invM*.
(xs, ys, zs, invM)
| 207 | |
| 208 | |
| 209 | def inv_transform(xs, ys, zs, invM): |
| 210 | """ |
| 211 | Transform the points by the inverse of the projection matrix, *invM*. |
| 212 | """ |
| 213 | vec = _vec_pad_ones(xs, ys, zs) |
| 214 | vecr = np.dot(invM, vec) |
| 215 | if vecr.shape == (4,): |
| 216 | vecr = vecr.reshape((4, 1)) |
| 217 | for i in range(vecr.shape[1]): |
| 218 | if vecr[3][i] != 0: |
| 219 | vecr[:, i] = vecr[:, i] / vecr[3][i] |
| 220 | return vecr[0], vecr[1], vecr[2] |
| 221 | |
| 222 | |
| 223 | def _vec_pad_ones(xs, ys, zs): |
nothing calls this directly
no test coverage detected
searching dependent graphs…