mapillary-js/test/helper/GeoHelper.ts
2021-03-27 18:34:32 +01:00

14 lines
413 B
TypeScript

import * as THREE from "three";
import { Spatial } from "../../src/geo/Spatial";
export class GeoHelper {
private spatial: Spatial = new Spatial();
public getTranslation(r: number[], C: number[]): number[] {
let R: THREE.Matrix4 = this.spatial.rotationMatrix(r);
let t: number[] = new THREE.Vector3().fromArray(C).applyMatrix4(R).multiplyScalar(-1).toArray();
return t;
}
}