-
Notifications
You must be signed in to change notification settings - Fork 92
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
texture based on file:// url won't load #297
Comments
Try passing |
I had this problem today with the latest expo-asset. Try this: class LocalIconMesh extends Mesh {
constructor() {
super();
this.geometry = new BoxGeometry(1, 1, 1);
const loader = new TextureLoader();
Asset.loadAsync(require('../assets/icon.png')).then(([{ localUri }]) => {
try {
loader.load(localUri, (texture) => {
this.material = new MeshBasicMaterial({ map: texture });
});
} catch (error) {
console.error(error);
}
});
}
} |
@markrickert Thanks for your work. BTW, I think your code is for loading texture from its own package. How can I load a texture from FileSystem? (ex: pick an image from gallery) |
Hi @orange4glace, sorry for the late reply. I just added an example in my updated fork. Everything is up to date in my implementation with three 0.166.0 and expo sdk 51. I added a demo of how to use local file paths via an image picker to the "bouncing balls" demo of my fork. You can check it out here: e9f0a1d |
followed this documentation:
https://github.com/expo/expo-three#loading-assets
texture based on remote image won't load:
i believe this has already been fixed in dependent libs, so you just have to update deps
The text was updated successfully, but these errors were encountered: