diff --git a/bim.js b/bim.js index 7b81347..b88af34 100644 --- a/bim.js +++ b/bim.js @@ -33,13 +33,13 @@ BIM.init = function (container) { */ BIM.createScene = function (container) { this.init(container); - - this.world.scene.setup(); // Add a grid to the scene const grids = this.components.get(OBC.Grids); const grid = grids.create(this.world); // (zoom_level, position) this.world.camera.controls.setLookAt(15, 15, 15, 0, 0, 0); + + this.world.scene.setup(); } /** * @param {HTMLElement} container The scene container element @@ -91,6 +91,10 @@ BIM.loadIfc = async function (buffer, name) { model.name = name; this.world.scene.three.add(model); + for (const fragment of model.items) { + this.world.meshes.add(fragment.mesh); + } + // Useful? this.fragments = fragments; this.model = model; @@ -140,4 +144,4 @@ BIM.setupHighligther = async function (model) { this.highlighter = highlighter; } -export default BIM; \ No newline at end of file +export default BIM;