63 lines
1.8 KiB
HTML
63 lines
1.8 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<link rel="icon" href="./demo/favicon.ico">
|
|
<link rel="stylesheet" type="text/css" href="./demo/global.css">
|
|
<style>
|
|
#myCanvas {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="app">
|
|
<div id="myCanvas" class="container"></div>
|
|
</div>
|
|
<script type="module">
|
|
import {
|
|
AxisGizmoPlugin,
|
|
BimViewer,
|
|
MeasurementPlugin,
|
|
NavCubePlugin,
|
|
SectionPlugin,
|
|
ToolbarMenuId,
|
|
} from "./demo/libs/gemini-viewer.esm.min.js";
|
|
|
|
const filename = "rac_basic_sample_project.gltf";
|
|
const modelCfg = {
|
|
modelId: filename,
|
|
name: filename,
|
|
src: `./demo/models/gltf/${filename}`,
|
|
edges: true,
|
|
};
|
|
const viewerCfg = {
|
|
containerId: "myCanvas",
|
|
language: "en",
|
|
}
|
|
const viewer = new BimViewer(viewerCfg);
|
|
const toolbar = viewer.toolbar;
|
|
toolbar.updateMenu(ToolbarMenuId.BimTree, { visible: false });
|
|
|
|
new AxisGizmoPlugin(viewer);
|
|
new MeasurementPlugin(viewer);
|
|
new NavCubePlugin(viewer);
|
|
new SectionPlugin(viewer);
|
|
|
|
// draco decoder path is needed to load draco encoded models.
|
|
// gemini-viewer js sdk user maintains draco decoder code somewhere, and provides the path here.
|
|
const decoderPath = "./demo/three/js/libs/draco/gltf/";
|
|
viewer.setDracoDecoderPath(decoderPath);
|
|
|
|
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> |