55
rated 0 times
[
62]
[
7]
/ answers: 1 / hits: 7481
/ 4 Years ago, thu, february 13, 2020, 12:00:00
I am trying to put an image on an object, like this:
var texture = new THREE.TextureLoader().load( 'crate.gif' );
var geometry = new THREE.BoxBufferGeometry( 200, 200, 200 );
var material = new THREE.MeshBasicMaterial( { map: texture } );
mesh = new THREE.Mesh( geometry, material );
scene.add( mesh );
I have crate.gif in my local folder, but it does not appear on the box.
I am expected to either run a web server, or I can use a data url, because local image loading does not work, as re-iterated by the developer.
- Running a web server is an unacceptable work-around and will not be considered.
- I may be willing to do the chore of converting every single image into Base64, but I don't know how to integrate that solution.
I realize the image may not be displaying because it hasn't loaded before being called. What is the easiest way to load an image?
More From » three.js