MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / sim3dToMatrix4

Function sim3dToMatrix4

src/utils/sim3dTransforms.ts:287–299  ·  view source on GitHub ↗
(sim3d: Sim3d)

Source from the content-addressed store, hash-verified

285 * The matrix can be applied to a Three.js group to transform all children.
286 */
287export function sim3dToMatrix4(sim3d: Sim3d): THREE.Matrix4 {
288 const matrix = new THREE.Matrix4();
289
290 // Compose: translation * rotation * scale
291 // THREE.Matrix4.compose(position, quaternion, scale)
292 matrix.compose(
293 sim3d.translation,
294 sim3d.rotation,
295 new THREE.Vector3(sim3d.scale, sim3d.scale, sim3d.scale)
296 );
297
298 return matrix;
299}
300
301/**
302 * Check if a Sim3dEuler represents an identity transform.

Callers 5

Scene3DE2EProbeFunction · 0.90
SceneContentFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected