Skip to content

Commit b7aaa0f

Browse files
committed
Upgrade three.js and removed wwobjloader2
1 parent df31f9c commit b7aaa0f

File tree

6 files changed

+15
-70
lines changed

6 files changed

+15
-70
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ might damage other software on your computer.
626626
1. Install [yarn](https://yarnpkg.com/en/docs/install). This should also install `node` and `npm`. Try running `yarn -v` and `npm -v` to make sure those programs are installed.
627627
2. Run `yarn`
628628
* This will read the `project.json` file and install all the necessary javascript dependencies.
629-
3. Run `npm run build`
629+
3. Run `yarn run build`
630630
* This will run webpack and create the bundled output in `dist/main.min.js`. The build script will also watch for changes to the MeshCat source files and regenerate the bundle whenever those source files change.
631631
4. Try it out! You can load the bundled `main.min.js` in your own application, or you can open up `dist/index.html` in your browser.
632632

dist/main.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.min.js.THIRD_PARTY_LICENSES.json

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,38 +28,11 @@
2828
},
2929
{
3030
"name": "three",
31-
"version": "0.163.0",
31+
"version": "0.176.0",
3232
"author": "mrdoob",
3333
"repository": "https://github.com/mrdoob/three.js",
34-
"source": "https://registry.npmjs.org/three/-/three-0.163.0.tgz",
34+
"source": "https://registry.npmjs.org/three/-/three-0.176.0.tgz",
3535
"license": "MIT",
36-
"licenseText": "The MIT License\n\nCopyright © 2010-2024 three.js authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
37-
},
38-
{
39-
"name": "wtd-core",
40-
"version": "3.0.0",
41-
"author": "kaisalmen (https://www.kaisalmen.de)",
42-
"repository": "https://github.com/kaisalmen/wtd",
43-
"source": "https://registry.npmjs.org/wtd-core/-/wtd-core-3.0.0.tgz",
44-
"license": "MIT",
45-
"licenseText": "MIT License\n\nCopyright (c) 2021-2024 Kai Salmen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
46-
},
47-
{
48-
"name": "wtd-three-ext",
49-
"version": "3.0.0",
50-
"author": "kaisalmen (https://www.kaisalmen.de)",
51-
"repository": "https://github.com/kaisalmen/wtd",
52-
"source": "https://registry.npmjs.org/wtd-three-ext/-/wtd-three-ext-3.0.0.tgz",
53-
"license": "MIT",
54-
"licenseText": "MIT License\n\nCopyright (c) 2021-2024 Kai Salmen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
55-
},
56-
{
57-
"name": "wwobjloader2",
58-
"version": "6.2.1",
59-
"author": "kaisalmen (https://www.kaisalmen.de)",
60-
"repository": "https://github.com/kaisalmen/WWOBJLoader",
61-
"source": "https://registry.npmjs.org/wwobjloader2/-/wwobjloader2-6.2.1.tgz",
62-
"license": "MIT",
63-
"licenseText": "MIT License\n\nCopyright (c) 2016-2022 Kai Salmen\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
36+
"licenseText": "The MIT License\n\nCopyright © 2010-2025 three.js authors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
6437
}
6538
]

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
"@msgpack/msgpack": "^2.8.0",
1515
"ccapture.js": "aceslowman/ccapture.js#npm-fix",
1616
"dat.gui": "^0.7.9",
17-
"three": "^0.163.0",
17+
"three": "^0.176.0",
1818
"three-wtm": "^1.0",
19-
"wwobjloader2": "^6.2.1",
2019
"yarn": "^1.22.21"
2120
},
2221
"scripts": {

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as THREE from 'three';
22
var msgpack = require('@msgpack/msgpack');
33
var dat = require('dat.gui').default; // TODO: why is .default needed?
44
import {mergeGeometries} from 'three/examples/jsm/utils/BufferGeometryUtils.js';
5-
import {OBJLoader2, MtlObjBridge} from 'wwobjloader2'
5+
import {OBJLoader} from 'three/addons/loaders/OBJLoader.js';
66
import {ColladaLoader} from 'three/examples/jsm/loaders/ColladaLoader.js';
77
import {DRACOLoader} from 'three/examples/jsm/loaders/DRACOLoader.js';
88
import {GLTFLoader} from 'three/examples/jsm/loaders/GLTFLoader.js';
@@ -196,7 +196,7 @@ function handle_special_geometry(geom) {
196196
}
197197
if (geom.type == "_meshfile_geometry") {
198198
if (geom.format == "obj") {
199-
let loader = new OBJLoader2();
199+
let loader = new OBJLoader();
200200
let obj = loader.parse(geom.data + "\n");
201201
let loaded_geom = merge_geometries(obj);
202202
loaded_geom.uuid = geom.uuid;
@@ -276,11 +276,11 @@ class ExtensibleObjectLoader extends THREE.ObjectLoader {
276276
return url;
277277
});
278278
if (json.format == "obj") {
279-
let loader = new OBJLoader2(manager);
279+
let loader = new OBJLoader(manager);
280280
if (json.mtl_library) {
281281
let mtl_loader = new MTLLoader(manager);
282-
let mtl_parse_result = mtl_loader.parse(json.mtl_library + "\n", "");
283-
let materials = MtlObjBridge.addMaterialsFromMtlLoader(mtl_parse_result);
282+
let materials = mtl_loader.parse(json.mtl_library + "\n", "");
283+
materials.preload();
284284
loader.setMaterials(materials);
285285
this.onTextureLoad();
286286
}

yarn.lock

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -785,15 +785,10 @@ three@^0.133.1:
785785
resolved "https://registry.yarnpkg.com/three/-/three-0.133.1.tgz#5606f4817d67a09d9212d4ccbd6826564774f8f4"
786786
integrity sha512-WydohO8ll949B0FTD6MGz59Yv2Lwj8hvObg/0Heh2r42S6+tQC1WByfCNRdmG4D7+odfGod+n8JPV1I2xrboWw==
787787

788-
three@^0.163.0, three@~0.163.0:
789-
version "0.163.0"
790-
resolved "https://registry.yarnpkg.com/three/-/three-0.163.0.tgz#cbfefbfd64a1353ab7cc8bf0fc396ddca1875a49"
791-
integrity sha512-HlMgCb2TF/dTLRtknBnjUTsR8FsDqBY43itYop2+Zg822I+Kd0Ua2vs8CvfBVefXkBdNDrLMoRTGCIIpfCuDew==
792-
793-
three@~0.160.0:
794-
version "0.160.1"
795-
resolved "https://registry.yarnpkg.com/three/-/three-0.160.1.tgz#61fe2907312e8604b1f64187f58e047503847413"
796-
integrity sha512-Bgl2wPJypDOZ1stAxwfWAcJ0WQf7QzlptsxkjYiURPz+n5k4RBDLsq+6f9Y75TYxn6aHLcWz+JNmwTOXWrQTBQ==
788+
three@^0.176.0:
789+
version "0.176.0"
790+
resolved "https://registry.yarnpkg.com/three/-/three-0.176.0.tgz#a30c1974e46db5745e4f96dd9ee2028d71e16ecf"
791+
integrity sha512-PWRKYWQo23ojf9oZSlRGH8K09q7nRSWx6LY/HF/UUrMdYgN9i1e2OwJYHoQjwc6HF/4lvvYLC5YC1X8UJL2ZpA==
797792

798793
undici-types@~5.26.4:
799794
version "5.26.5"
@@ -909,28 +904,6 @@ wildcard@^2.0.0:
909904
resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67"
910905
integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==
911906

912-
wtd-core@~3.0.0:
913-
version "3.0.0"
914-
resolved "https://registry.yarnpkg.com/wtd-core/-/wtd-core-3.0.0.tgz#bff8005de29a37df807844e16dcfb36df3c64cd9"
915-
integrity sha512-LSPfAQ5ULSV5vPhipcjdQvV5xOx25QesYK23jwUOF99xOx6fuulk7CMQerERRwA4uoQooNmRd8AT6IPBwORlWQ==
916-
917-
wtd-three-ext@~3.0.0:
918-
version "3.0.0"
919-
resolved "https://registry.yarnpkg.com/wtd-three-ext/-/wtd-three-ext-3.0.0.tgz#4d12f951635bd41313d790f74908f71e9e379b2c"
920-
integrity sha512-PLZJipCAiinot8D1uB4A7+XHxPAYeZXDhczbbazK7pKdqpE77zMizQH4rSZsaNbzktgnIfpgK/ODqhJTdrUjUw==
921-
dependencies:
922-
three "~0.160.0"
923-
wtd-core "~3.0.0"
924-
925-
wwobjloader2@^6.2.1:
926-
version "6.2.1"
927-
resolved "https://registry.yarnpkg.com/wwobjloader2/-/wwobjloader2-6.2.1.tgz#59513efaa46cde5e1f751279fcca31abdcb0aae9"
928-
integrity sha512-/v/sfUX0PMQAI8souzCs6xsO9LR3RyL+ujnOiS/1pngUlakKyHYC5XMQvu77pTeWzY3rzNyt5Q/bg5O3RukA+g==
929-
dependencies:
930-
three "~0.163.0"
931-
wtd-core "~3.0.0"
932-
wtd-three-ext "~3.0.0"
933-
934907
yarn@^1.22.21:
935908
version "1.22.22"
936909
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.22.tgz#ac34549e6aa8e7ead463a7407e1c7390f61a6610"

0 commit comments

Comments
 (0)