MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / getImageWorldPosition

Function getImageWorldPosition

src/utils/colmapTransforms.ts:31–35  ·  view source on GitHub ↗
(image: Image)

Source from the content-addressed store, hash-verified

29 * Converts from world-to-camera (qvec, tvec) to camera position in world space.
30 */
31export function getImageWorldPosition(image: Image): THREE.Vector3 {
32 const quat = getImageWorldQuaternion(image);
33 const t = new THREE.Vector3(image.tvec[0], image.tvec[1], image.tvec[2]);
34 return t.negate().applyQuaternion(quat);
35}
36
37/**
38 * Get both world position and quaternion for an image.

Calls 1

getImageWorldQuaternionFunction · 0.85

Tested by

no test coverage detected