How to use the Loader function from three

Find comprehensive JavaScript three.Loader code examples handpicked from public code repositorys.

54
55
56
57
58
59
60
61
62
63
  */
}

load ( url, rootPath, assetMap, rootName, rootFileExt ) {

  const baseURL = THREE.Loader.prototype.extractUrlBase(url);

  return new Promise((resolve, reject) => {

    const manager = new THREE.LoadingManager();
fork icon460
star icon11
watch icon4

4
5
6
7
8
9
10
11
12
13
 * @author Mugen87 / https://github.com/Mugen87
 */

THREE.ColladaLoader = function (manager) {

        THREE.Loader.call(this, manager);

};

THREE.ColladaLoader.prototype = Object.assign(Object.create(THREE.Loader.prototype), {
fork icon278
star icon0
watch icon1

+ 15 other calls in file

559
560
561
562
563
564
565
566
567
},

loadTexture: function ( url, mapping, onLoad, onProgress, onError ) {

	var texture;
	var loader = THREE.Loader.Handlers.get( url );
	var manager = ( this.manager !== undefined ) ? this.manager : THREE.DefaultLoadingManager;

	if ( loader === null ) {
fork icon3
star icon6
watch icon1

+ 18 other calls in file

9
10
11
12
13
14
15
16
17
18
/* three-svg-loader mod */
var THREE = require('three')

var SVGLoader = function ( manager ) {

        THREE.Loader.call( this, manager );

};

/* three-svg-loader mod */
fork icon3
star icon3
watch icon1

+ 11 other calls in file

18
19
20
21
22
23
24
25
26
27

        this.withCredentials = false;

}

LegacyJSONLoader.prototype = Object.assign( Object.create( THREE.Loader.prototype ), {

        constructor: LegacyJSONLoader,

        load: function ( url, onLoad, onProgress, onError ) {
fork icon3
star icon7
watch icon8

+ 15 other calls in file

476
477
478
479
480
481
482
483
484
},

loadTexture: function loadTexture(url, mapping, onLoad, onProgress, onError) {

	var texture = void 0;
	var loader = THREE.Loader.Handlers.get(url);
	var manager = this.manager !== undefined ? this.manager : THREE.DefaultLoadingManager;

	if (loader === null) {
fork icon0
star icon2
watch icon1

517
518
519
520
521
522
523
524
525
},

loadTexture: function ( url, mapping, onLoad, onProgress, onError ) {

	let texture;
	let loader = THREE.Loader.Handlers.get( url );
	let manager = ( this.manager !== undefined ) ? this.manager : THREE.DefaultLoadingManager;

	if ( loader === null ) {
fork icon0
star icon0
watch icon2

+ 21 other calls in file

1868
1869
1870
1871
1872
1873
1874
1875
1876
1877

return Promise.resolve( sourceURI ).then( function ( sourceURI ) {

	// Load Texture resource.

	var loader = THREE.Loader.Handlers.get( sourceURI );

	if ( ! loader ) {

		loader = textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ]
fork icon0
star icon0
watch icon0

+ 8 other calls in file

248
249
250
251
252
253
254
255
256
257
} else {
  if (THREE.Loader.Handlers.get('.tga') === null) {
    var tgaLoader = new THREE.TGALoader();
    tgaLoader.setPath(this.textureLoader.path);

    THREE.Loader.Handlers.add(/\.tga$/i, tgaLoader);
  }

  type = 'image/tga';
  break;
fork icon0
star icon0
watch icon0

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)