@needle-tools/gltf-progressive 2.1.6-next.c9b2e8b → 2.1.6-next.fa4044e
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/examples/react-three-fiber/src/App.tsx +38 -0
- package/examples/react-three-fiber/src/index.tsx +12 -0
- package/examples/react-three-fiber/src/styles.css +16 -0
- package/examples/react-three-fiber/tsconfig.json +22 -0
- package/gltf-progressive.js +1098 -0
- package/gltf-progressive.min.js +8 -0
- package/gltf-progressive.umd.cjs +8 -0
- package/{dist/lib → lib}/extension.d.ts +10 -6
- package/{dist/lib → lib}/extension.js +20 -94
- package/lib/lods.debug.d.ts +4 -0
- package/lib/lods.debug.js +41 -0
- package/{dist/lib → lib}/lods_manager.d.ts +6 -1
- package/{dist/lib → lib}/lods_manager.js +26 -10
- package/{dist/lib → lib}/plugins/plugin.d.ts +2 -2
- package/{dist/lib → lib}/version.js +1 -1
- package/package.json +14 -17
- package/.github/workflows/publish.yml +0 -47
- package/dist/CHANGELOG.md +0 -211
- package/dist/README.md +0 -129
- package/dist/examples/modelviewer-multiple.html +0 -126
- package/dist/examples/modelviewer.html +0 -34
- package/dist/examples/react-three-fiber/.prettierrc +0 -10
- package/dist/examples/react-three-fiber/favicon.png +0 -0
- package/dist/examples/react-three-fiber/index.html +0 -24
- package/dist/examples/react-three-fiber/package-lock.json +0 -4023
- package/dist/examples/react-three-fiber/package.json +0 -34
- package/dist/examples/react-three-fiber/vite.config.js +0 -39
- package/dist/examples/threejs/index.html +0 -52
- package/dist/examples/threejs/main.js +0 -181
- package/dist/gltf-progressive.js +0 -1107
- package/dist/gltf-progressive.min.js +0 -8
- package/dist/gltf-progressive.umd.cjs +0 -8
- package/dist/package.json +0 -65
- /package/{dist/lib → lib}/index.d.ts +0 -0
- /package/{dist/lib → lib}/index.js +0 -0
- /package/{dist/lib → lib}/loaders.d.ts +0 -0
- /package/{dist/lib → lib}/loaders.js +0 -0
- /package/{dist/lib → lib}/plugins/index.d.ts +0 -0
- /package/{dist/lib → lib}/plugins/index.js +0 -0
- /package/{dist/lib → lib}/plugins/modelviewer.d.ts +0 -0
- /package/{dist/lib → lib}/plugins/modelviewer.js +0 -0
- /package/{dist/lib → lib}/plugins/plugin.js +0 -0
- /package/{dist/lib → lib}/utils.d.ts +0 -0
- /package/{dist/lib → lib}/utils.internal.d.ts +0 -0
- /package/{dist/lib → lib}/utils.internal.js +0 -0
- /package/{dist/lib → lib}/utils.js +0 -0
- /package/{dist/lib → lib}/version.d.ts +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
import { Canvas, useThree } from '@react-three/fiber'
|
|
6
|
+
|
|
7
|
+
import { useNeedleProgressive } from '@needle-tools/gltf-progressive'
|
|
8
|
+
import { Environment, OrbitControls, useGLTF } from '@react-three/drei'
|
|
9
|
+
|
|
10
|
+
function MyModel() {
|
|
11
|
+
const { gl } = useThree()
|
|
12
|
+
const url = 'https://engine.needle.tools/demos/gltf-progressive/assets/church/model.glb'
|
|
13
|
+
const { scene } = useGLTF(url, false, false, (loader) => {
|
|
14
|
+
useNeedleProgressive(url, gl, loader as any)
|
|
15
|
+
})
|
|
16
|
+
return <primitive object={scene} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export default function App() {
|
|
21
|
+
return (
|
|
22
|
+
<Canvas
|
|
23
|
+
frameloop="demand"
|
|
24
|
+
camera={{ position: [25, 15, 25] }}>
|
|
25
|
+
<OrbitControls target={[0 , 10, 0]} />
|
|
26
|
+
<ambientLight intensity={1} />
|
|
27
|
+
<spotLight position={[10, 10, 10]} angle={0.15} penumbra={1} />
|
|
28
|
+
<pointLight position={[-10, -10, -10]} />
|
|
29
|
+
<Environment
|
|
30
|
+
files="https://dl.polyhaven.org/file/ph-assets/HDRIs/hdr/2k/evening_road_01_2k.hdr"
|
|
31
|
+
// ground={{ height: 5, radius: 40, scale: 10 }}
|
|
32
|
+
/>
|
|
33
|
+
<MyModel />
|
|
34
|
+
</Canvas>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"jsx": "react",
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"lib": ["ESNext", "DOM"],
|
|
8
|
+
"moduleResolution": "Node",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"noUnusedLocals": false,
|
|
15
|
+
"noUnusedParameters": true,
|
|
16
|
+
"noImplicitReturns": true,
|
|
17
|
+
"noImplicitAny": false,
|
|
18
|
+
"experimentalDecorators": true,
|
|
19
|
+
"skipLibCheck": true
|
|
20
|
+
},
|
|
21
|
+
"include": ["./src"]
|
|
22
|
+
}
|