Added one more gltf model and example page as well
This commit is contained in:
@ -3,9 +3,12 @@
|
||||
"subMenus": [{
|
||||
"title": "本地模型加载",
|
||||
"url": "./demo/empty_model_project.html"
|
||||
}, {
|
||||
"title": "Rac basic sample project",
|
||||
"url": "./demo/bim_0.html"
|
||||
}, {
|
||||
"title": "Duplex",
|
||||
"url": "./demo/duplex.html"
|
||||
"url": "./demo/bim_1.html"
|
||||
}]
|
||||
}, {
|
||||
"title": "图纸",
|
||||
@ -13,7 +16,7 @@
|
||||
"title": "本地图纸加载",
|
||||
"url": "../demo/empty_dxf_project.html"
|
||||
}, {
|
||||
"title": "Rac Basic Sample Project",
|
||||
"title": "Rac basic sample project",
|
||||
"url": "./demo/dxf_0.html"
|
||||
}, {
|
||||
"title": "城市公寓",
|
||||
|
@ -27,8 +27,7 @@
|
||||
|
||||
const project = {
|
||||
"id": "rac_basic_sample_project",
|
||||
"name": "rac_basic_sample_project",
|
||||
"thumbnail": "./demo/projects/rac_basic_sample_project/thumbnail.png",
|
||||
"name": "Rac basic sample project",
|
||||
"camera": {
|
||||
"eye": [-70, 25, 50],
|
||||
"look": [-35, 0, 35],
|
||||
@ -36,8 +35,8 @@
|
||||
"far": 10000
|
||||
},
|
||||
"models": [{
|
||||
"name": "rac basic sample project",
|
||||
"src": "./demo/projects/rac_basic_sample_project/rac_basic_sample_project.gltf",
|
||||
"name": "Rac basic sample project",
|
||||
"src": "./demo/models/gltf/rac_basic_sample_project.gltf",
|
||||
"position": [0, 0, 0],
|
||||
"rotation": [0, 0, 0],
|
||||
"scale": [1, 1, 1],
|
||||
@ -63,7 +62,7 @@
|
||||
viewer.loadModel(modelCfg, (event) => {
|
||||
console.log(`[Demo] Loading model ${modelCfg.src}`);
|
||||
}, (event) => {
|
||||
console.error("Failed to load " + modelCfg.src + ". " + event.message);
|
||||
console.error("[Demo] Failed to load " + modelCfg.src + ". " + event.message);
|
||||
}).then(() => {
|
||||
console.log(`[Demo] Loaded model ${modelCfg.src}`);
|
||||
});
|
69
public/demo/bim_1.html
Normal file
69
public/demo/bim_1.html
Normal file
@ -0,0 +1,69 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<link rel="icon" href="./demo/favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="./demo/global.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="viewerContainer">
|
||||
<div id="myCanvas" class="renderer-container"></div>
|
||||
</div>
|
||||
<script type="module">
|
||||
import { BimViewer, ToolbarMenuId } from "./demo/libs/gemini-viewer.esm.min.js";
|
||||
|
||||
const project = {
|
||||
id: "Duplex",
|
||||
name: "Duplex",
|
||||
models: [
|
||||
{
|
||||
name: "Duplex",
|
||||
src: "./demo/models/gltf/Duplex.gltf",
|
||||
position: [0, 0, 0],
|
||||
rotation: [0, 0, 0],
|
||||
scale: [1, 1, 1],
|
||||
instantiate: false,
|
||||
merge: false,
|
||||
edges: true,
|
||||
visible: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
const viewer = new BimViewer(
|
||||
{
|
||||
containerId: "myCanvas",
|
||||
enableAxisGizmo: true,
|
||||
enableStats: true,
|
||||
toolbarMenuConfig: {
|
||||
[ToolbarMenuId.Measure]: { visible: false },
|
||||
[ToolbarMenuId.Fullscreen]: { visible: false },
|
||||
[ToolbarMenuId.BimTree]: { visible: false },
|
||||
},
|
||||
enableBottomBar: true,
|
||||
enableNavCube: true,
|
||||
enableContextMenu: true,
|
||||
},
|
||||
project.camera
|
||||
);
|
||||
|
||||
// loadProjectModel
|
||||
let counter = 0; // to indicate how many models are loading
|
||||
project.models.forEach((modelCfg) => {
|
||||
if (modelCfg.visible === false) {
|
||||
// visible is true by default
|
||||
return; // only load visible ones
|
||||
}
|
||||
counter++;
|
||||
viewer.loadModel(modelCfg, (event) => {
|
||||
console.log(`[Demo] Loading model ${modelCfg.src}`);
|
||||
}, (event) => {
|
||||
console.error("[Demo] Failed to load " + modelCfg.src + ". " + event.message);
|
||||
}
|
||||
).then(() => {
|
||||
console.log(`[Demo] Loaded model ${modelCfg.src}`);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -52,7 +52,7 @@
|
||||
|
||||
<body>
|
||||
<div id="viewerContainer">
|
||||
<div id="myDxfViewerContainer" class="renderer-container"></div>
|
||||
<div id="myCanvas" class="renderer-container"></div>
|
||||
</div>
|
||||
<div style="position: absolute; top: 10px; opacity: 0.6; width: 100%;text-align: center;">
|
||||
<div class="upload-btn" id="uploadBtn">
|
||||
@ -76,7 +76,7 @@
|
||||
import LayerManager from './demo/layerManager/LayerManager.js';
|
||||
|
||||
const config = {
|
||||
containerId: "myDxfViewerContainer",
|
||||
containerId: "myCanvas",
|
||||
enableAxisGizmo: true,
|
||||
enableStats: true,
|
||||
enableToolbar: true,
|
||||
|
@ -50,7 +50,7 @@
|
||||
|
||||
<body>
|
||||
<div id="viewerContainer">
|
||||
<div id="myBimViewerContainer" class="renderer-container"></div>
|
||||
<div id="myCanvas" class="renderer-container"></div>
|
||||
</div>
|
||||
<div style="position: absolute; top: 10px; opacity: 0.6; width: 100%;text-align: center;">
|
||||
<div class="upload-btn" id="uploadBtn">
|
||||
@ -67,7 +67,6 @@
|
||||
const project = {
|
||||
id: "empty_project",
|
||||
name: "Empty project",
|
||||
thumbnail: "./demo/projects/empty_project/thumbnail.png",
|
||||
camera: {
|
||||
},
|
||||
models: [{
|
||||
@ -81,7 +80,7 @@
|
||||
};
|
||||
const bimViewer = new BimViewer(
|
||||
{
|
||||
containerId: "myBimViewerContainer",
|
||||
containerId: "myCanvas",
|
||||
enableAxisGizmo: true,
|
||||
enableStats: true,
|
||||
toolbarMenuConfig: {
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
<body>
|
||||
<div id="viewerContainer">
|
||||
<div id="myVRViewerContainer" class="renderer-container"></div>
|
||||
<div id="myCanvas" class="renderer-container"></div>
|
||||
</div>
|
||||
<div style="position: absolute; top: 10px; opacity: 0.6; width: 100%;text-align: center;">
|
||||
<div class="upload-btn" id="uploadBtn">
|
||||
@ -64,7 +64,7 @@
|
||||
import { VRViewer, LocalImageUploader } from "./demio/libs/gemini-viewer.esm.min.js";
|
||||
|
||||
const config = {
|
||||
containerId: "myVRViewerContainer",
|
||||
containerId: "myCanvas",
|
||||
enableAxisGizmo: true,
|
||||
enableBottomBar: true,
|
||||
}
|
||||
|
BIN
public/demo/models/gltf/rac_basic_sample_project.bin
Normal file
BIN
public/demo/models/gltf/rac_basic_sample_project.bin
Normal file
Binary file not shown.
1
public/demo/models/gltf/rac_basic_sample_project.gltf
Normal file
1
public/demo/models/gltf/rac_basic_sample_project.gltf
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user