You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A javascript library to import BOM (Binary Object/Material) files into three.js. Loaded assets will be output as a THREE.Mesh
3
+
consisting of THREE.BufferGeometry and an associated THREE.Material. Multi-material assets may be split into multiple THREE.Mesh objects, per material.
Then create an instance of BOMLoader and specify the file path to load:
12
+
### Javascript
13
+
```javascript
14
+
var filePath ='https://example.com/path/to/file.bom';
15
+
16
+
var loader =newTHREE.BOMLoader();
17
+
//loader.setDebug(true); // Output verbose debugging information (Disabled/false by default)
18
+
//loader.setPerfTimer(true); // Output loader performance timer information (Disabled/false by default)
19
+
loader.setTexturePath(filePath.split('/').slice(0, -1).join('/') +'/'); // Specify base texture path
20
+
21
+
loader.load(filePath, function(obj) {
22
+
scene.add(obj); // Add object to scene once loaded.
23
+
});
24
+
```
25
+
26
+
## See also
27
+
[obj2bom](https://github.com/NGenesis/bom-obj2bom) - A command line tool to convert OBJ and associated MTL files to BOM (Binary Object/Material) file format.
0 commit comments