-
-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit the js file to import the gltf model ? #19
Comments
it's the same, you can do it as you like. if you console.log your import it's most likely a url anyway, just hashed. it's better that way, you get to control caching and the asset doesn't have to be part of /public. perhaps this should also be the default, but some build tools maybe can't handle "gltf"? |
Maybe! In my recat project i don't know why it doesn't work when i place the gltf file in/public folder... But i will continue with this kind of import ... Thank you for your help on this !! |
public isn't part of the bundle, cra for instance explicitely forbids importing anything outside of src. that#s the main difference, /public isn't poart of the bundle and it's fetched via root path, import is a splitbundle. |
Oh ok, so i understand ! |
Hi!
First of all, thank you a lot for this beautiful work !
I would like to know is there is a reason why i should edit the react component model.js to import the gltf model instead of using directly the url as the example ?
Example : const { nodes, materials } = useLoader(GLTFLoader, '/model.gltf')
My project :
import model from "./model.gltf)
const { nodes, materials } = useLoader(GLTFLoader, model)
Thank you !
F.
The text was updated successfully, but these errors were encountered: