MCPcopy Create free account
hub / github.com/Anttwo/SuGaR / getWorld2View2

Function getWorld2View2

sugar_utils/graphics_utils.py:52–63  ·  view source on GitHub ↗
(R, t, translate=np.array([.0, .0, .0]), scale=1.0)

Source from the content-addressed store, hash-verified

50 return np.float32(Rt)
51
52def getWorld2View2(R, t, translate=np.array([.0, .0, .0]), scale=1.0):
53 Rt = np.zeros((4, 4))
54 Rt[:3, :3] = R.transpose()
55 Rt[:3, 3] = t
56 Rt[3, 3] = 1.0
57
58 C2W = np.linalg.inv(Rt)
59 cam_center = C2W[:3, 3]
60 cam_center = (cam_center + translate) * scale
61 C2W[:3, 3] = cam_center
62 Rt = np.linalg.inv(C2W)
63 return np.float32(Rt)
64
65def getProjectionMatrix(znear, zfar, fovX, fovY):
66 tanHalfFovY = math.tan((fovY / 2))

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected