createTextureAsync from remote dynamic image file
See original GitHub issueImages can be loaded as a material using code like the following:
const img = require('./assets/images/myImage.jpg');
const material = new THREE.MeshBasicMaterial({
map: await ExpoTHREE.createTextureAsync({
asset: Expo.Asset.fromModule(img),
})
});
How can we create a material from a remote file determined at runtime (where require()
is not available) and we cannot create an Expo.Asset
?
Here are some attempts I’ve made, with no luck:
var expoAsset = new Expo.Asset();
expoAsset.uri = "https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png";
const material = new THREE.MeshBasicMaterial({
map: await ExpoTHREE.createTextureAsync({
asset: expoAsset
})
});
var textureLoader = new THREE.TextureLoader();
textureLoader.load("https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png", function(loadedTexture) {
const material = new THREE.MeshBasicMaterial({ map: loadedTexture });
});
var loadingManager = new THREE.LoadingManager();
var imageLoader = new THREE.ImageLoader(loadingManager);
imageLoader.load("https://s3.amazonaws.com/exp-brand-assets/ExponentEmptyManifest_192.png", function(image) {
var texture = new THREE.Texture();
texture.image = image;
var material = new THREE.MeshBasicMaterial( {map: texture});
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
React Native - Image Require Module using Dynamic Names
First, create a file with image required - React native images must be loaded this way. assets/index.js export const friendsandfoe = require('.
Read more >Dynamic Image API | Customer's Canvas Dev
Dynamic Image API. BuildInfo. Controller for getting information about the application. ... If true , overwrites the image if its file name already...
Read more >About dynamic image assets - Google Ads Help
Dynamic image assets are an account level automated asset that allows Google to curate relevant visuals from your ad's landing page to complement...
Read more >Include live remote image in Beamer presentation - TeX
The remote image will be refreshed every three seconds. ... it recognizes the file suffix; so if you are building dynamic images in...
Read more >How to load images dynamically? - Google Groups
new Image("path to remote image file here");.. Salvador Diaz's profile photo ... Also note that ImageBundles cannot be generated dynamically as they're
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ericmorgan1 just pushed
expo-three
: 2.0.7.You can now call:
Snack: https://snack.expo.io/@bacon/expo-three-remote-image
@EvanBacon , How to load the 3d object like this. I tried with so many methods to load an object. All gets failed. Please anyone help me to load 3d object in .obj, .gltf, or .glb any of one format in react native.