MCPcopy Index your code
hub / github.com/SpectacularAI/sdk / lookAt

Function lookAt

python/cli/visualization/visualizer_renderers/util.py:25–38  ·  view source on GitHub ↗
(eye, center, up)

Source from the content-addressed store, hash-verified

23 return program
24
25def lookAt(eye, center, up):
26 forward = center - eye
27 forward = forward / np.linalg.norm(forward)
28 up = up / np.linalg.norm(up)
29 right = np.cross(forward, up)
30 newUp = np.cross(forward, right)
31
32 # view matrix
33 return np.array([
34 [right[0], right[1], right[2], -np.dot(right, eye)],
35 [newUp[0], newUp[1], newUp[2], -np.dot(newUp, eye)],
36 [forward[0], forward[1], forward[2], -np.dot(forward, eye)],
37 [0, 0, 0, 1]
38 ])
39
40def getOrthographicProjectionMatrixOpenGL(left, right, bottom, top, near, far):
41 return np.array([

Callers 1

__renderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected