@needle-tools/gltf-progressive 1.0.0-alpha.13 → 1.0.0-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +6 -0
- package/examples/modelviewer.html +4 -4
- package/examples/threejs/index.html +1 -1
- package/examples/threejs/main.js +8 -8
- package/gltf-progressive.js +182 -154
- package/gltf-progressive.min.js +3 -3
- package/gltf-progressive.umd.cjs +3 -3
- package/lib/extension.js +4 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.js +5 -4
- package/lib/lods_manager.d.ts +37 -2
- package/lib/lods_manager.js +54 -4
- package/lib/plugins/index.d.ts +1 -1
- package/lib/plugins/index.js +0 -1
- package/lib/plugins/modelviewer.js +7 -3
- package/lib/plugins/plugin.d.ts +0 -4
- package/lib/plugins/plugin.js +0 -6
- package/lib/utils.d.ts +13 -0
- package/lib/utils.js +24 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [1.0.0-alpha.15] - 2023-05-24
|
|
8
|
+
- add: `getRaycastMesh` method
|
|
9
|
+
- add: LODsManager does now expose `targetTriangleDensity`. The target triangle density is the desired max amount of triangles on screen when the mesh is filling the screen.
|
|
10
|
+
- change: create LODsManager via `LODsManager.get(renderer)`
|
|
11
|
+
|
|
12
|
+
## [1.0.0-alpha.13] - 2023-05-24
|
|
13
|
+
- fix: modelviewer error when trying to access undefined texture extensions
|
|
14
|
+
|
|
7
15
|
## [1.0.0-alpha.13] - 2023-05-24
|
|
8
16
|
- add: vanilla three.js example
|
|
9
17
|
- fix: texture LODs losing filter setting
|
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Support for loading of glTF or GLB files with progressive mesh or texture data for three.js based engines.
|
|
4
4
|
|
|
5
|
+
## Samples
|
|
6
|
+
|
|
7
|
+
- [Vanilla three.js Example](https://engine.needle.tools/demos/gltf-progressive/threejs/)
|
|
8
|
+
- [\<model-viewer\> Example](https://engine.needle.tools/demos/gltf-progressive/modelviewer)
|
|
9
|
+
|
|
10
|
+
|
|
5
11
|
# Contact ✒️
|
|
6
12
|
<b>[🌵 needle — tools for creators](https://needle.tools)</b> •
|
|
7
13
|
[Twitter](https://twitter.com/NeedleTools) •
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
}
|
|
12
12
|
</script>
|
|
13
13
|
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js"></script>
|
|
14
|
-
<script type="module" src="https://www.unpkg.com/@needle-tools/gltf-progressive@
|
|
14
|
+
<script type="module" src="https://www.unpkg.com/@needle-tools/gltf-progressive@latest"></script>
|
|
15
15
|
</head>
|
|
16
16
|
|
|
17
|
-
<model-viewer src="https://engine.needle.tools/demos/
|
|
18
|
-
touch-action="pan-y"></model-viewer>
|
|
17
|
+
<model-viewer src="https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb" ar shadow-intensity="1"
|
|
18
|
+
camera-controls touch-action="pan-y" auto-rotate max-camera-orbit="auto 90deg auto"></model-viewer>
|
|
19
19
|
|
|
20
20
|
<style>
|
|
21
21
|
model-viewer {
|
|
22
22
|
width: 100%;
|
|
23
|
-
height:
|
|
23
|
+
height: 100%;
|
|
24
24
|
}
|
|
25
25
|
</style>
|
|
26
26
|
|
package/examples/threejs/main.js
CHANGED
|
@@ -20,16 +20,16 @@ window.addEventListener('resize', () => {
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
const orbit = new OrbitControls(camera, renderer.domElement);
|
|
23
|
-
orbit.target = new THREE.Vector3(0,
|
|
24
|
-
camera.position.x =
|
|
25
|
-
camera.position.y =
|
|
26
|
-
camera.position.z =
|
|
23
|
+
orbit.target = new THREE.Vector3(0, 14, 0);
|
|
24
|
+
camera.position.x = 20;
|
|
25
|
+
camera.position.y = 20.5;
|
|
26
|
+
camera.position.z = 20.8;
|
|
27
27
|
|
|
28
|
-
const grid = new THREE.GridHelper(
|
|
28
|
+
const grid = new THREE.GridHelper(50, 50, 0x444444, 0x666666);
|
|
29
29
|
scene.add(grid);
|
|
30
30
|
|
|
31
|
-
const directionalLight = new THREE.DirectionalLight(0xffffff,
|
|
32
|
-
directionalLight.position.set(
|
|
31
|
+
const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
|
|
32
|
+
directionalLight.position.set(-50, 20, 50);
|
|
33
33
|
scene.add(directionalLight);
|
|
34
34
|
|
|
35
35
|
|
|
@@ -56,7 +56,7 @@ new EXRLoader().load(environmentTextureUrl, texture => {
|
|
|
56
56
|
|
|
57
57
|
// Integrate @needle-tools/gltf-progressive
|
|
58
58
|
// This is the model we want to load
|
|
59
|
-
const url = "https://engine.needle.tools/demos/gltf-progressive/
|
|
59
|
+
const url = "https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb";
|
|
60
60
|
|
|
61
61
|
const gltfLoader = new GLTFLoader();
|
|
62
62
|
|