feat(demo): add multi-tab demo with dual BimEngine instances
New demo page with two independent BimEngine instances side by side, draggable divider for resizing, and proper SDK-layer resize handling. Replaces the iframe-based approach now that ManagerRegistry is instance-based. Removes unused panelViewer vite config entry. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -171,6 +171,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 7. 多Tab加载 -->
|
||||
<div class="control-group">
|
||||
<h2>📺 多Tab加载 (Multi-Tab)</h2>
|
||||
<div class="btn-container">
|
||||
<button class="primary" onclick="window.open('./multi-tab.html', '_blank')">打开多Tab视图</button>
|
||||
</div>
|
||||
<div style="margin-top: 8px; font-size: 0.8rem; color: #888;">
|
||||
两个独立面板,各自加载模型,可拖拽分割线调整宽度
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 5. 3D 引擎 -->
|
||||
<div class="control-group">
|
||||
<h2>🎮 3D 引擎 (Engine3D)</h2>
|
||||
@@ -178,6 +189,7 @@
|
||||
<button class="primary" onclick="initEngine3D()">初始化引擎</button>
|
||||
<button class="primary" onclick="loadModel()">加载模型</button>
|
||||
<button onclick="switchModel()">切换模型</button>
|
||||
<button onclick="loadCombinedModel()">组合模型</button>
|
||||
</div>
|
||||
<div class="btn-container" style="margin-top: 8px;">
|
||||
<button onclick="pauseRendering()">暂停渲染</button>
|
||||
@@ -410,6 +422,38 @@
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载组合模型 - 同时加载多个模型
|
||||
*/
|
||||
function loadCombinedModel() {
|
||||
if (!engine || !engine.engine) {
|
||||
alert('引擎未创建,请先等待页面加载完成');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!engine.engine.isInitialized()) {
|
||||
alert('请先初始化 3D 引擎!');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const modelUrls = [
|
||||
'https://lyz-1259524260.cos.ap-guangzhou.myqcloud.com/iflow/models/417664a3-76c8-4d94-9344-1337246a5d4e/',
|
||||
'https://lyz-1259524260.cos.ap-guangzhou.myqcloud.com/iflow/models/e49a5fd1-3018-4938-9a52-6862b56a190b/'
|
||||
];
|
||||
|
||||
engine.engine.loadModel(modelUrls, {
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0],
|
||||
scale: [1, 1, 1]
|
||||
});
|
||||
|
||||
console.log('✅ 组合模型加载请求已发送:', modelUrls);
|
||||
} catch (error) {
|
||||
console.error('❌ 组合模型加载错误:', error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停渲染
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user