diff options
-rw-r--r-- | src/App.jsx | 8 | ||||
-rw-r--r-- | src/components/chatbubble.jsx | 2 | ||||
-rw-r--r-- | src/components/ground.jsx | 3 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/App.jsx b/src/App.jsx index 81cd893..e154f5b 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,9 +7,9 @@ import React, { Suspense, useContext, useEffect, useRef, useState } from 'react' import { Physics } from '@react-three/rapier'; import Sun from './components/sun'; import * as everforest from './_everforest.module.scss' -import { Bloom, EffectComposer, GodRays, LensFlare, Noise, Vignette } from '@react-three/postprocessing'; -import { AdditiveBlending } from 'three'; import { useGLTF } from '@react-three/drei'; +import terrainModelURL from './assets/terrain.glb'; +import messageBubbleModelURL from './assets/message-bubble.glb'; export const AppContext = React.createContext(null); @@ -55,8 +55,8 @@ function App() { setMessages(data); }); },[]); - useGLTF.preload('../assets/terrain.glb'); - useGLTF.preload('../assets/message-bubble.glb'); + useGLTF.preload(terrainModelURL); + useGLTF.preload(messageBubbleModelURL); return ( <> <div className='dot' /> diff --git a/src/components/chatbubble.jsx b/src/components/chatbubble.jsx index 04a8147..9494ecb 100644 --- a/src/components/chatbubble.jsx +++ b/src/components/chatbubble.jsx @@ -6,7 +6,7 @@ import { Html } from '@react-three/drei'; import { AppContext } from '../App'; import Color from 'color'; import { Vector3 } from 'three'; -const messageBubbleModelURL = new URL('../assets/message-bubble.glb', import.meta.url).href +import messageBubbleModelURL from '../assets/message-bubble.glb'; export default function ChatBubble({ id, position, text }) { const meshRef = useRef(); diff --git a/src/components/ground.jsx b/src/components/ground.jsx index 9aa736d..9aced45 100644 --- a/src/components/ground.jsx +++ b/src/components/ground.jsx @@ -2,8 +2,7 @@ import { useRef } from 'react'; import * as everforest from '../_everforest.module.scss' import { RigidBody } from '@react-three/rapier'; import { useGLTF } from '@react-three/drei'; - -const terrainModelURL = new URL('../assets/terrain.glb', import.meta.url).href +import terrainModelURL from '../assets/terrain.glb'; export default function Ground() { const meshRef = useRef(); |