现版本
This commit is contained in:
@@ -220,6 +220,11 @@
|
||||
<button onclick="loadCombinedModel()">组合模型</button>
|
||||
<button onclick="openCombineDialog()">自动组合</button>
|
||||
</div>
|
||||
<div style="margin-top: 8px;">
|
||||
<input type="text" id="url-input-3d"
|
||||
style="width:100%;padding:6px 8px;font-size:0.85rem;border:1px solid #ddd;border-radius:4px;font-family:Consolas,Monaco,monospace;outline:none;"
|
||||
placeholder="输入模型 URL(支持粘贴后切换)" />
|
||||
</div>
|
||||
<div class="btn-container" style="margin-top: 8px;">
|
||||
<button onclick="pauseRendering()">暂停渲染</button>
|
||||
<button onclick="resumeRendering()">恢复渲染</button>
|
||||
@@ -290,7 +295,8 @@
|
||||
<div
|
||||
style="background:#fff; border-radius:10px; padding:24px; width:560px; max-width:90vw; box-shadow:0 8px 32px rgba(0,0,0,.18);">
|
||||
<h3 style="margin:0 0 12px; font-size:1.1rem; color:#333;">跳转到构件视角</h3>
|
||||
<p style="margin:0 0 10px; font-size:.85rem; color:#888;">请输入相机配置 JSON(参考格式:modelJson.cameraRestorePose):</p>
|
||||
<p style="margin:0 0 10px; font-size:.85rem; color:#888;">请输入相机配置 JSON(参考格式:modelJson.cameraRestorePose):
|
||||
</p>
|
||||
<textarea id="jump-camera-json" rows="12"
|
||||
style="width:100%; padding:10px; font-size:.85rem; border:1px solid #ddd; border-radius:6px; resize:vertical; font-family:monospace;"
|
||||
placeholder='{
|
||||
@@ -302,7 +308,8 @@
|
||||
<div style="margin-top:10px; font-size:.8rem; color:#666;">
|
||||
<details>
|
||||
<summary style="cursor:pointer; color:#0078d4;">查看完整示例格式</summary>
|
||||
<pre style="margin-top:8px; padding:10px; background:#f5f5f5; border-radius:4px; overflow-x:auto; font-size:.75rem;">{
|
||||
<pre
|
||||
style="margin-top:8px; padding:10px; background:#f5f5f5; border-radius:4px; overflow-x:auto; font-size:.75rem;">{
|
||||
"type": "orthographic",
|
||||
"position": {"x": 229.68, "y": 247.98, "z": 233.79},
|
||||
"rotation": {"x": -0.79, "y": 0.62, "z": 0.52},
|
||||
@@ -332,6 +339,9 @@
|
||||
let unsubscribePresetSaved = null;
|
||||
let unsubscribePresetChanged = null;
|
||||
let unsubscribePresetDeleted = null;
|
||||
const DEFAULT_3D_MODEL_URL = 'https://lyz-1259524260.cos.ap-guangzhou.myqcloud.com/iflow/models/417664a3-76c8-4d94-9344-1337246a5d4e/';
|
||||
//const DEFAULT_3D_MODEL_URL = 'https://pub-8092fd0db2e14822a9f742ad0050750c.r2.dev/66ad9a66-5ca8-47ac-9139-6aa8756069c1/';
|
||||
let current3dModelUrl = DEFAULT_3D_MODEL_URL;
|
||||
|
||||
const PRESET_CACHE_KEY = 'iflow-demo-setting-presets-v1';
|
||||
|
||||
@@ -450,6 +460,10 @@
|
||||
window.onload = () => {
|
||||
if (window.IflowEngine) {
|
||||
try {
|
||||
const modelInput = document.getElementById('url-input-3d');
|
||||
if (modelInput) {
|
||||
modelInput.value = current3dModelUrl;
|
||||
}
|
||||
initEngine3D();
|
||||
} catch (err) {
|
||||
console.error('Init failed:', err);
|
||||
@@ -624,8 +638,15 @@
|
||||
alert('请先初始化 3D 引擎!');
|
||||
return;
|
||||
}
|
||||
|
||||
const urlInput = document.getElementById('url-input-3d');
|
||||
const inputValue = urlInput && urlInput.value ? urlInput.value.trim() : '';
|
||||
if (inputValue) {
|
||||
current3dModelUrl = inputValue;
|
||||
}
|
||||
|
||||
const modelUrl = current3dModelUrl;
|
||||
try {
|
||||
var modelUrl = 'https://lyz-1259524260.cos.ap-guangzhou.myqcloud.com/iflow/models/417664a3-76c8-4d94-9344-1337246a5d4e/';
|
||||
engine.engine.loadModel([modelUrl], {
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0],
|
||||
@@ -682,15 +703,22 @@
|
||||
alert('请先初始化 3D 引擎!');
|
||||
return;
|
||||
}
|
||||
var newUrl = prompt('请输入新的模型 URL:', 'https://lyz-1259524260.cos.ap-guangzhou.myqcloud.com/iflow/models/8634e556-a94e-4ba7-be3e-2ea1507cced5/');
|
||||
if (!newUrl || newUrl.trim() === '') return;
|
||||
|
||||
var urlInput = document.getElementById('url-input-3d');
|
||||
var newUrl = urlInput && urlInput.value ? urlInput.value.trim() : '';
|
||||
if (!newUrl) {
|
||||
alert('请输入模型 URL');
|
||||
return;
|
||||
}
|
||||
|
||||
current3dModelUrl = newUrl;
|
||||
try {
|
||||
engine.engine.loadModel([newUrl.trim()], {
|
||||
engine.engine.loadModel([current3dModelUrl], {
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0],
|
||||
scale: [1, 1, 1]
|
||||
});
|
||||
console.log('✅ 切换模型请求已发送:', newUrl);
|
||||
console.log('✅ 切换模型请求已发送:', current3dModelUrl);
|
||||
} catch (error) {
|
||||
console.error('❌ 切换模型错误:', error);
|
||||
}
|
||||
@@ -1100,4 +1128,4 @@
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user