Dynamically import echarts and three.js (#2349)

This commit is contained in:
Gold856
2026-02-02 11:06:48 -05:00
committed by GitHub
parent 798b01c3a6
commit f4b30da6b3
5 changed files with 33 additions and 12 deletions

View File

@@ -65,7 +65,7 @@ const createChessboard = (obs: BoardObservation, cal: CameraCalibrationResult):
let previousTargets: Object3D[] = [];
let baseAspect: number | undefined;
const drawCalibration = (cal: CameraCalibrationResult | null) => {
const drawCalibration = async (cal: CameraCalibrationResult | null) => {
// Check here, since if we check in watchEffect this never gets called
if (!cal || !scene || !camera || !renderer || !controls) {
return;
@@ -95,7 +95,7 @@ const drawCalibration = (cal: CameraCalibrationResult | null) => {
});
// And show camera frustum
const calibCamera = createPerspectiveCamera(props.resolution, cal.cameraIntrinsics);
const calibCamera = await createPerspectiveCamera(props.resolution, cal.cameraIntrinsics);
const helper = new CameraHelper(calibCamera);
// Flip to +Z forward