MCPcopy Create free account
hub / github.com/NVlabs/InstantSplat / viewmatrix

Function viewmatrix

utils/camera_utils.py:185–191  ·  view source on GitHub ↗

Construct lookat view matrix.

(lookdir, up, position)

Source from the content-addressed store, hash-verified

183
184
185def viewmatrix(lookdir, up, position):
186 """Construct lookat view matrix."""
187 vec2 = normalize(lookdir)
188 vec0 = normalize(np.cross(up, vec2))
189 vec1 = normalize(np.cross(vec2, vec0))
190 m = np.stack([vec0, vec1, vec2, position], axis=1)
191 return m
192
193def normalize(x):
194 """Normalization helper function."""

Callers 1

points_to_posesFunction · 0.70

Calls 1

normalizeFunction · 0.70

Tested by

no test coverage detected