Add grid; clipping plane
This commit is contained in:
parent
0d0190fd8e
commit
13be63c40a
6 changed files with 236 additions and 44 deletions
18
app/three/utils/utils.ts
Normal file
18
app/three/utils/utils.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Vector3 } from "three";
|
||||
import { Extent } from "./build-scene";
|
||||
|
||||
export function getMaxSize(extent: Extent) {
|
||||
return Math.max(
|
||||
extent.xmax - extent.xmin,
|
||||
extent.ymax - extent.ymin,
|
||||
extent.zmax - extent.zmin
|
||||
);
|
||||
}
|
||||
|
||||
export function getCenter3D(extent: Extent) {
|
||||
return new Vector3(
|
||||
(extent.xmin + extent.xmax) / 2,
|
||||
(extent.ymin + extent.ymax) / 2,
|
||||
(extent.zmax + extent.zmin) / 2
|
||||
);
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue