You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WebCAD/__test__/Geometry/maritx.test.ts

31 lines
613 B

import { Matrix4, Vector3 } from "three";
import { matrixAlignCoordSys } from "../../src/Common/Matrix4Utils";
test('坐标系对齐', () =>
{
let m1 =
new Matrix4().makeBasis(
new Vector3(0, 1),
new Vector3(-1, 0),
new Vector3(0, 0, 1),
);
m1.setPosition(new Vector3(1, 0, 0));
let m2 = new Matrix4().makeBasis(
new Vector3(-1),
new Vector3(0, -1),
new Vector3(0, 0, 1)
);
let m3 = matrixAlignCoordSys(m1, m2);
let v = new Vector3(-2, 5, 0);
v.applyMatrix4(m3);
expect(v).toMatchSnapshot();
});