How to use the ImageLoader function from three

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

10
11
12
13
14
15
16
17
18
19
require('three/examples/js/loaders/GLTFLoader')
require('../vendor/three/examples/js/loaders/OBJLoader2')
const loadingManager = new THREE.LoadingManager()
const objLoader = new THREE.OBJLoader2(loadingManager)
const gltfLoader = new THREE.GLTFLoader(loadingManager)
const imageLoader = new THREE.ImageLoader(loadingManager)

objLoader.setLogging(false, false)

const materialFactory = () => new THREE.MeshToonMaterial({
fork icon263
star icon0
watch icon2

5201
5202
5203
5204
5205
5206
5207
5208
5209
5210

}

function loadTextureImage ( texture, url ) {

	var loader = new THREE.ImageLoader();

	loader.load( url, function ( image ) {

		texture.image = image;
fork icon0
star icon0
watch icon2

+ 10 other calls in file

7
8
9
10
11
12
13
14
15
16
17
18
  THREE.TextureLoader.prototype.crossOrigin = 'anonymous';
}


// This is for images loaded from the model loaders.
if (THREE.ImageLoader) {
  THREE.ImageLoader.prototype.crossOrigin = 'anonymous';
}


// In-memory caching for XHRs (for images, audio files, textures, etc.).
if (THREE.Cache) {
fork icon0
star icon0
watch icon0

+ 7 other calls in file

7
8
9
10
11
12
13
14
15
16
17
18
  THREE.TextureLoader.prototype.crossOrigin = '';
}


// This is for images loaded from the model loaders.
if (THREE.ImageLoader) {
  THREE.ImageLoader.prototype.crossOrigin = '';
}


// In-memory caching for XHRs (for images, audio files, textures, etc.).
if (THREE.Cache) {
fork icon0
star icon0
watch icon0

+ 3 other calls in file

95
96
97
98
99
100
101
102
103
104

context.font = "18px serif";
context.fillText(name, 10, 50);


// let imgLoader = new THREE.ImageLoader();
// imgLoader.load(dialogImg, (image) => {
//              console.log(image)
//              let pattern = context.createPattern(image, 'no-repeat')
//              context.fillStyle = pattern
fork icon0
star icon0
watch icon1

Other functions in three

Sorted by popularity

function icon

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