INNER CODE UNIT · Python
base
muskie82/MonoGS · gui/gui_utils.py:28
base = np.array([[0.0, 0.0, 0.0]]) * self.size
base_hmg = np.hstack([base, np.ones((base.shape[0], 1))])
cameraeye = pose @ base_hmg.transpose()
cameraeye = cameraeye[0:3, :].transpose()
eye = cameraeye[0, :]
base_behind = np.array([[0.0, -2.5, -30.0]]) * self.size
base_behind_hmg = np.hstack([base_behind, np.ones((base_behind.shape[0], 1))])
cameraeye_behind = pose @ base_behind_hmg.transpose()
cameraeye_behind = cameraeye_behind[0:3, :].transpose()
eye_behind = cameraeye_behind[0, :]
center = np.mean(points[1:, :], axis=0)
up = points[2] - points[4]
self.view_dir = (center, eye, up, pose)
self.view_dir_behind = (center, eye_behind, up, pose)