This commit is contained in:
nicomacbookpro
2025-08-20 15:27:42 +08:00
parent 120f31aa9e
commit 00f40dba99

View File

@@ -546,25 +546,24 @@ export function drawAxes(element, options = {}, ballCallBack) {
g.position.set(0, 0, 0);
gridGroup.add(g);
}
if (typeof grid_uv_right !== "undefined" && grid_uv_right) {
// 右侧
const g = createCustomGridAA(sizeZ, sizeY, ...grid_uv_right, color, px);
g.rotation.y = -Math.PI / 2;
g.position.set(sizeX, 0, 0);
gridGroup.add(g);
}
if (typeof grid_uv_front !== "undefined" && grid_uv_front) {
// 前侧
const g = createCustomGridAA(sizeX, sizeY, ...grid_uv_front, color, px);
g.position.set(0, 0, sizeZ);
gridGroup.add(g);
}
// if (typeof grid_uv_right !== "undefined" && grid_uv_right) {
// // 右侧
// const g = createCustomGridAA(sizeZ, sizeY, ...grid_uv_right, color, px);
// g.rotation.y = -Math.PI / 2;
// g.position.set(sizeX, 0, 0);
// gridGroup.add(g);
// }
// if (typeof grid_uv_front !== "undefined" && grid_uv_front) {
// // 前侧
// const g = createCustomGridAA(sizeX, sizeY, ...grid_uv_front, color, px);
// g.position.set(0, 0, sizeZ);
// gridGroup.add(g);
// }
// 后侧 using
let gris_back_g = null;
if (typeof grid_uv_back !== "undefined" && grid_uv_back) {
// 后侧
gris_back_g = createCustomGridAA(sizeX, sizeY, ...grid_uv_back, color, px);
gris_back_g.position.set(0, 0, 0);
gridGroup.add(gris_back_g);
}
@@ -1247,7 +1246,3 @@ async function addPositiveAxes(scene, sizeX, sizeY, sizeZ) {
scene.add(zAxis);
}
/* ========== DEMO用例直接渲染到页面的第一个div上 ========== */
// const demo1 = drawAxes(document.querySelector("div"), {});
// setInterval(()=>demo1.dispose(),2000); // 定时销毁示例(如需测试资源释放)