diff --git a/config/threeExamples.mjs b/config/threeExamples.mjs index 86022d1044..939093334b 100644 --- a/config/threeExamples.mjs +++ b/config/threeExamples.mjs @@ -5,5 +5,6 @@ export default { './loaders/DRACOLoader.js', './loaders/DDSLoader.js', './capabilities/WebGL.js', + './utils/BufferGeometryUtils.js', ], }; diff --git a/examples/itowns-potree.html b/examples/itowns-potree.html index c9f3dd89c0..9c3c5262ee 100644 --- a/examples/itowns-potree.html +++ b/examples/itowns-potree.html @@ -34,7 +34,7 @@ with `itowns.THREE` or `itowns.proj4`. --> diff --git a/examples/view_multi_25d.html b/examples/view_multi_25d.html index dde280775c..7a3671f7ff 100644 --- a/examples/view_multi_25d.html +++ b/examples/view_multi_25d.html @@ -79,7 +79,7 @@ // `viewerDiv` will contain iTowns' rendering area (``) viewerDiv = document.getElementById('viewerDiv'); - itowns.THREE.Object3D.DefaultUp.set(0, 0, 1); + itowns.THREE.Object3D.DEFAULT_UP.set(0, 0, 1); scale = new itowns.THREE.Vector3(1, 1, 1).divideScalar(extent.planarDimensions().x); diff --git a/package.json b/package.json index 3c78377365..08f6b8f745 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ }, "peerDependencies": { "proj4": "^2.8.0", - "three": "0.146.0" + "three": "0.152.0" }, "devDependencies": { "@babel/cli": "^7.17.10", @@ -109,8 +109,8 @@ "puppeteer": "^14.1.1", "q": "^1.5.1", "replace-in-file": "^6.3.2", - "three": "0.146.0", "url-polyfill": "^1.1.12", + "three": "0.152.0", "webpack": "^5.72.1", "webpack-cli": "^4.9.2", "webpack-dev-server": "^4.9.0", diff --git a/src/Converter/Feature2Texture.js b/src/Converter/Feature2Texture.js index e3f1945c47..03190bc8aa 100644 --- a/src/Converter/Feature2Texture.js +++ b/src/Converter/Feature2Texture.js @@ -210,7 +210,7 @@ export default { data[0] = backgroundColor.r * 255; data[1] = backgroundColor.g * 255; data[2] = backgroundColor.b * 255; - texture = new THREE.DataTexture(data, 1, 1, THREE.RGBFormat); + texture = new THREE.DataTexture(data, 1, 1, THREE.RGBAFormat); } else { texture = new THREE.Texture(); } diff --git a/src/Core/Prefab/GlobeView.js b/src/Core/Prefab/GlobeView.js index 4327821ed4..2b891756ad 100644 --- a/src/Core/Prefab/GlobeView.js +++ b/src/Core/Prefab/GlobeView.js @@ -94,7 +94,7 @@ class GlobeView extends View { * @param {Object} options.controls - See options of {@link GlobeControls} */ constructor(viewerDiv, placement = {}, options = {}) { - THREE.Object3D.DefaultUp.set(0, 0, 1); + THREE.Object3D.DEFAULT_UP.set(0, 0, 1); // Setup View super('EPSG:4978', viewerDiv, options); this.isGlobeView = true; diff --git a/src/Core/Prefab/PlanarView.js b/src/Core/Prefab/PlanarView.js index 74de41f0b2..f9f1bbcd15 100644 --- a/src/Core/Prefab/PlanarView.js +++ b/src/Core/Prefab/PlanarView.js @@ -33,7 +33,7 @@ class PlanarView extends View { * initialization. By default, camera will display the view's extent (given in `extent` parameter). */ constructor(viewerDiv, extent, options = {}) { - THREE.Object3D.DefaultUp.set(0, 0, 1); + THREE.Object3D.DEFAULT_UP.set(0, 0, 1); // Setup View super(extent.crs, viewerDiv, options); diff --git a/src/Parser/deprecated/LegacyGLTFLoader.js b/src/Parser/deprecated/LegacyGLTFLoader.js index a4c069c73b..69ce367870 100644 --- a/src/Parser/deprecated/LegacyGLTFLoader.js +++ b/src/Parser/deprecated/LegacyGLTFLoader.js @@ -452,7 +452,7 @@ threeExamples.LegacyGLTFLoader = ( function () { var WEBGL_TEXTURE_FORMATS = { 6406: THREE.AlphaFormat, - 6407: THREE.RGBFormat, + 6407: THREE.RGBAFormat, 6408: THREE.RGBAFormat, 6409: THREE.LuminanceFormat, 6410: THREE.LuminanceAlphaFormat diff --git a/src/Utils/CameraUtils.js b/src/Utils/CameraUtils.js index ec6a57d7bd..63ecc90607 100644 --- a/src/Utils/CameraUtils.js +++ b/src/Utils/CameraUtils.js @@ -7,7 +7,7 @@ import Ellipsoid from 'Core/Math/Ellipsoid'; import OBB from 'Renderer/OBB'; import { VIEW_EVENTS } from 'Core/View'; -THREE.Object3D.DefaultUp.set(0, 0, 1); +THREE.Object3D.DEFAULT_UP.set(0, 0, 1); const targetPosition = new THREE.Vector3(); const targetCoord = new Coordinates('EPSG:4326', 0, 0, 0); const ellipsoid = new Ellipsoid(); diff --git a/test/unit/cameraUtils.js b/test/unit/cameraUtils.js index f76135b9cf..a8e57c059c 100644 --- a/test/unit/cameraUtils.js +++ b/test/unit/cameraUtils.js @@ -15,7 +15,7 @@ function equalToFixed(value1, value2, toFixed) { } describe('Camera utils unit test', function () { - THREE.Object3D.DefaultUp = new THREE.Vector3(0, 0, 1); + THREE.Object3D.DEFAULT_UP = new THREE.Vector3(0, 0, 1); const original = DEMUtils.getElevationValueAt;