Skip to content

Instantly share code, notes, and snippets.

@Surgeon
Last active March 2, 2018 10:37
Show Gist options
  • Select an option

  • Save Surgeon/ec1915e3e310f54fa647d1f083ed04d0 to your computer and use it in GitHub Desktop.

Select an option

Save Surgeon/ec1915e3e310f54fa647d1f083ed04d0 to your computer and use it in GitHub Desktop.
THREE.TextureLoader
// instantiate a loader
var loader = new THREE.TextureLoader();
//allow cross origin loading
loader.crossOrigin = '';
// load a resource
loader.load('textures/land_ocean_ice_cloud_2048.jpg',
// Function when resource is loaded
function ( texture ) {},
// Function called when download progresses
function ( xhr ) {},
// Function called when download errors
function ( xhr ) {}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment