diff --git a/examples/minecraft/src/App.jsx b/examples/minecraft/src/App.jsx index d789b96..7a61a4c 100644 --- a/examples/minecraft/src/App.jsx +++ b/examples/minecraft/src/App.jsx @@ -15,7 +15,27 @@ const store = createXRStore() export function App() { return ( <> - + - + diff --git a/examples/pingpong/vite.config.ts b/examples/pingpong/vite.config.ts index 48ee6a5..fcbf70e 100644 --- a/examples/pingpong/vite.config.ts +++ b/examples/pingpong/vite.config.ts @@ -6,6 +6,7 @@ import basicSsl from '@vitejs/plugin-basic-ssl' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), basicSsl()], + base: '/xr/examples/pingpong/', resolve: { alias: [{ find: '@react-three/xr', replacement: path.resolve(__dirname, '../../packages/react/xr/src/index.ts') }], dedupe: ['@react-three/fiber', 'three'], diff --git a/examples/rag-doll/src/App.jsx b/examples/rag-doll/src/App.jsx index f48a0d1..c59c05d 100644 --- a/examples/rag-doll/src/App.jsx +++ b/examples/rag-doll/src/App.jsx @@ -14,7 +14,27 @@ const store = createXRStore({ export function App() { return ( <> - + diff --git a/examples/rag-doll/src/components/Furniture.jsx b/examples/rag-doll/src/components/Furniture.jsx index 17b66c4..c68c507 100644 --- a/examples/rag-doll/src/components/Furniture.jsx +++ b/examples/rag-doll/src/components/Furniture.jsx @@ -40,7 +40,7 @@ export function Chair(props) { } export function Mug(props) { - const { nodes, materials } = useGLTF('/cup.glb') + const { nodes, materials } = useGLTF('cup.glb') const [cup] = useCylinder(() => ({ mass: 1, args: [0.62, 0.62, 1.2, 16], diff --git a/examples/rag-doll/vite.config.ts b/examples/rag-doll/vite.config.ts index 48ee6a5..728f5ba 100644 --- a/examples/rag-doll/vite.config.ts +++ b/examples/rag-doll/vite.config.ts @@ -6,6 +6,7 @@ import basicSsl from '@vitejs/plugin-basic-ssl' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), basicSsl()], + base: '/xr/examples/rad-doll/', resolve: { alias: [{ find: '@react-three/xr', replacement: path.resolve(__dirname, '../../packages/react/xr/src/index.ts') }], dedupe: ['@react-three/fiber', 'three'], diff --git a/examples/room-with-shadows/src/App.jsx b/examples/room-with-shadows/src/App.jsx index 59bf239..15f76f8 100644 --- a/examples/room-with-shadows/src/App.jsx +++ b/examples/room-with-shadows/src/App.jsx @@ -29,7 +29,27 @@ const store = createXRStore() export default function App() { return ( <> - + set(true)} /> diff --git a/examples/room-with-shadows/src/Room.jsx b/examples/room-with-shadows/src/Room.jsx index 6d39406..6f2eed4 100644 --- a/examples/room-with-shadows/src/Room.jsx +++ b/examples/room-with-shadows/src/Room.jsx @@ -7,30 +7,30 @@ Source: https://sketchfab.com/3d-models/room-6417cbc1870a4a1691cca06912ae0369 Title: Room */ -import { useGLTF } from "@react-three/drei" +import { useGLTF } from '@react-three/drei' export function Model(props) { - const { nodes, materials } = useGLTF("/room-transformed.glb") + const { nodes, materials } = useGLTF('room-transformed.glb') return ( - - + + - - - + + + - - + + @@ -38,4 +38,4 @@ export function Model(props) { ) } -useGLTF.preload("/room-transformed.glb") +useGLTF.preload('room-transformed.glb') diff --git a/examples/room-with-shadows/vite.config.ts b/examples/room-with-shadows/vite.config.ts index 48ee6a5..87cae60 100644 --- a/examples/room-with-shadows/vite.config.ts +++ b/examples/room-with-shadows/vite.config.ts @@ -6,6 +6,7 @@ import basicSsl from '@vitejs/plugin-basic-ssl' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), basicSsl()], + base: '/xr/examples/room-with-shadows/', resolve: { alias: [{ find: '@react-three/xr', replacement: path.resolve(__dirname, '../../packages/react/xr/src/index.ts') }], dedupe: ['@react-three/fiber', 'three'], diff --git a/examples/stage/src/App.jsx b/examples/stage/src/App.jsx index f1ae295..12b9830 100644 --- a/examples/stage/src/App.jsx +++ b/examples/stage/src/App.jsx @@ -9,7 +9,27 @@ const store = createXRStore() export default function App() { return ( <> - + diff --git a/examples/stage/src/Cobra.jsx b/examples/stage/src/Cobra.jsx index f6e5fb1..f311c0a 100644 --- a/examples/stage/src/Cobra.jsx +++ b/examples/stage/src/Cobra.jsx @@ -6,27 +6,123 @@ Command: npx gltfjsx@6.2.5 cobra.glb --transform import { useGLTF } from '@react-three/drei' export function Model({ color, ...props }) { - const { nodes, materials } = useGLTF('/cobra-transformed.glb') + const { nodes, materials } = useGLTF('cobra-transformed.glb') return ( - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + ) } -useGLTF.preload('/cobra-transformed.glb') +useGLTF.preload('cobra-transformed.glb') diff --git a/examples/stage/src/Datsun.jsx b/examples/stage/src/Datsun.jsx index 1ee36b3..6f328cb 100644 --- a/examples/stage/src/Datsun.jsx +++ b/examples/stage/src/Datsun.jsx @@ -9,7 +9,7 @@ title: (FREE) 1972 Datsun 240k GT import { useGLTF } from '@react-three/drei' export function Model({ color, ...props }) { - const { nodes, materials } = useGLTF('/datsun-transformed.glb') + const { nodes, materials } = useGLTF('datsun-transformed.glb') return ( @@ -19,7 +19,12 @@ export function Model({ color, ...props }) { - + @@ -28,4 +33,4 @@ export function Model({ color, ...props }) { ) } -useGLTF.preload('/datsun-transformed.glb') +useGLTF.preload('datsun-transformed.glb') diff --git a/examples/stage/vite.config.ts b/examples/stage/vite.config.ts index 48ee6a5..7ae9496 100644 --- a/examples/stage/vite.config.ts +++ b/examples/stage/vite.config.ts @@ -6,6 +6,7 @@ import basicSsl from '@vitejs/plugin-basic-ssl' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), basicSsl()], + base: '/xr/examples/stage/', resolve: { alias: [{ find: '@react-three/xr', replacement: path.resolve(__dirname, '../../packages/react/xr/src/index.ts') }], dedupe: ['@react-three/fiber', 'three'], diff --git a/examples/watch/src/App.jsx b/examples/watch/src/App.jsx index 8176cae..9da6607 100644 --- a/examples/watch/src/App.jsx +++ b/examples/watch/src/App.jsx @@ -9,7 +9,27 @@ const store = createXRStore({ export default function App() { return ( <> - + diff --git a/examples/watch/src/Hand.jsx b/examples/watch/src/Hand.jsx index e5f4b8c..aa26117 100644 --- a/examples/watch/src/Hand.jsx +++ b/examples/watch/src/Hand.jsx @@ -16,7 +16,7 @@ export function HandWithWatch() { } function Watch(props) { - const { nodes, materials } = useGLTF('/watch-v1.glb') + const { nodes, materials } = useGLTF('watch-v1.glb') return ( diff --git a/examples/watch/vite.config.ts b/examples/watch/vite.config.ts index 48ee6a5..20d2326 100644 --- a/examples/watch/vite.config.ts +++ b/examples/watch/vite.config.ts @@ -6,6 +6,7 @@ import basicSsl from '@vitejs/plugin-basic-ssl' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react(), basicSsl()], + base: '/xr/examples/watch/', resolve: { alias: [{ find: '@react-three/xr', replacement: path.resolve(__dirname, '../../packages/react/xr/src/index.ts') }], dedupe: ['@react-three/fiber', 'three'],