(R, t, translate=np.array([.0, .0, .0]), scale=1.0)
| 36 | return np.float32(Rt) |
| 37 | |
| 38 | def getWorld2View2(R, t, translate=np.array([.0, .0, .0]), scale=1.0): |
| 39 | Rt = np.zeros((4, 4)) |
| 40 | Rt[:3, :3] = R.transpose() |
| 41 | Rt[:3, 3] = t |
| 42 | Rt[3, 3] = 1.0 |
| 43 | |
| 44 | C2W = np.linalg.inv(Rt) |
| 45 | cam_center = C2W[:3, 3] |
| 46 | cam_center = (cam_center + translate) * scale |
| 47 | C2W[:3, 3] = cam_center |
| 48 | Rt = np.linalg.inv(C2W) |
| 49 | return np.float32(Rt) |
| 50 | |
| 51 | def getProjectionMatrix(znear, zfar, fovX, fovY): |
| 52 | tanHalfFovY = math.tan((fovY / 2)) |
no outgoing calls
no test coverage detected