Skip to content

Commit

Permalink
Updated example to three.js r87, AltspaceSDK 2.6.1 and altspaceutil 0…
Browse files Browse the repository at this point in the history
….8.1.

Updated BOMLoader to support r87.
  • Loading branch information
David Cormack committed Oct 12, 2017
1 parent 61017e3 commit 8659187
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ consisting of THREE.BufferGeometry and an associated THREE.Material. Multi-mate
## Usage
Include the loader library in your project:
```html
<script src="https://cdn.rawgit.com/NGenesis/bom-three.js/v0.4/examples/js/loaders/BOMLoader.min.js"></script>
<script src="https://cdn.rawgit.com/NGenesis/bom-three.js/v0.5/examples/js/loaders/BOMLoader.min.js"></script>
```

Then create an instance of BOMLoader and specify the file path to load:
Expand Down
6 changes: 3 additions & 3 deletions examples/altspace/lightmap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<head>
<meta charset=utf-8>
<title>BOM Lightmap Example</title>
<script src="https://cdn.rawgit.com/mrdoob/three.js/r85/build/three.min.js"></script>
<script src="https://cdn.rawgit.com/AltspaceVR/AltspaceSDK/v2.4.4/dist/altspace.min.js"></script>
<script src="https://cdn.rawgit.com/NGenesis/altspacevr-behaviors/v0.5.2/js/NativeComponent.js"></script>
<script src="https://cdn.rawgit.com/mrdoob/three.js/r87/build/three.min.js"></script>
<script src="https://cdn.rawgit.com/AltspaceVR/AltspaceSDK/v2.6.1/dist/altspace.min.js"></script>
<script src="https://cdn.rawgit.com/NGenesis/altspacevr-behaviors/v0.8.1/js/altspaceutil.min.js"></script>
<script src="../../js/loaders/BOMLoader.min.js"></script>
<script type="text/javascript">
var sim = new altspace.utilities.Simulation();
Expand Down
5 changes: 4 additions & 1 deletion examples/js/loaders/BOMLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,10 @@ THREE.BOMLoader.prototype = {
// Material ID
var materialId = readUint16();
material = materials[ materialId ].clone() || new THREE.MeshPhongMaterial();
material.shading = ( smoothing > 0 ) ? THREE.SmoothShading : THREE.FlatShading;

if( material.flatShading ) material.flatShading = ( smoothing <= 0 );
else material.shading = ( smoothing > 0 ) ? THREE.SmoothShading : THREE.FlatShading;

if ( this.debug ) console.log( 'Group Material', materialId, material );

}
Expand Down

0 comments on commit 8659187

Please # to comment.