How to use the RepeatWrapping function from three

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

830
831
832
833
834
835
836
837
838

function textureToPattern( texture ) {

	if ( texture instanceof THREE.CompressedTexture ) return;

	var repeatX = texture.wrapS === THREE.RepeatWrapping;
	var repeatY = texture.wrapT === THREE.RepeatWrapping;

	var image = texture.image;
fork icon183
star icon861
watch icon0

+ 5 other calls in file

53
54
55
56
57
58
59
60
61
62
controls.enableZoom = false;

const textureLoader = new THREE.TextureLoader();
scene.background = textureLoader.load('assets/dust_scratches.png');
scene.background.wrapS = THREE.RepeatWrapping;
scene.background.wrapT = THREE.RepeatWrapping;
scene.background.repeat.set( 2, 2 );

this.canvas = canvas;
this.renderer = renderer;
fork icon15
star icon120
watch icon9

+ 3 other calls in file

33
34
35
36
37
38
39
40
41
42
  this.currentFrame = 0;
  this.clock = new three_1.Clock();
  this.end$ = new rxjs_1.Subject();
  this.tilesTotalAmount -= 1; // indexing from 0
  this.frameDisplayDuration = 1000 / framesPerSecond;
  this.texture.wrapS = three_1.RepeatWrapping;
  this.texture.wrapT = three_1.RepeatWrapping;
  this.texture.repeat.set(1 / tilesAmountHorizontally, 1 / tilesAmountVertically);
}
/**
fork icon8
star icon63
watch icon0

82
83
84
85
86
87
88
89
90
    sphere.castShadow = true;
    scene.add(sphere);    
}
    
var ground = THREE.ImageUtils.loadTexture("img/ground.jpg");
ground.wrapS = THREE.RepeatWrapping;
ground.wrapT = THREE.RepeatWrapping;
ground.repeat.x = 15;
ground.repeat.y = 15;
fork icon2
star icon51
watch icon7

+ 3 other calls in file

46
47
48
49
50
51
52
53
54
55

// load a resource
sprite.loadingStarted = true;
loader.load(sprite.src, spriteTexture => {
    sprite.texture = spriteTexture;
    sprite.texture.wrapS = sprite.texture.wrapT = THREE.RepeatWrapping;

    // repeat is the number of times the texture should repeat on each
    // axis.  when it's less than one, we indicate that it should be a
    // fraction of the image
fork icon3
star icon20
watch icon5

15
16
17
18
19
20
21
22
23
24
loader.load("models/ball.js", function(geometry, materials) {
    // geometry.applyMatrix(new THREE.Matrix4().makeRotationX(Math.PI/2))
    geometry.computeVertexNormals()

    var nrm = THREE.ImageUtils.loadTexture(normUrl)
    nrm.wrapS = nrm.wrapT = THREE.RepeatWrapping
    nrm.minFilter = nrm.magFilter = THREE.LinearFilter
    nrm.generateMipmaps = false

    var tex = THREE.ImageUtils.loadTexture(matCapUrl) //mcap1, mcap4
fork icon2
star icon16
watch icon2

+ 3 other calls in file

1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
    9987: THREE.LinearMipmapLinearFilter
};
const WEBGL_WRAPPINGS = {
    33071: THREE.ClampToEdgeWrapping,
    33648: THREE.MirroredRepeatWrapping,
    10497: THREE.RepeatWrapping
};
const WEBGL_TYPE_SIZES = {
    'SCALAR': 1,
    'VEC2': 2,
fork icon2
star icon10
watch icon0

+ 5 other calls in file

1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
texture.magFilter =
  WEBGL_FILTERS[sampler.magFilter] || THREE.LinearFilter;
texture.minFilter =
  WEBGL_FILTERS[sampler.minFilter] || THREE.LinearMipmapLinearFilter;
texture.wrapS =
  WEBGL_WRAPPINGS[sampler.wrapS] || THREE.RepeatWrapping;
texture.wrapT =
  WEBGL_WRAPPINGS[sampler.wrapT] || THREE.RepeatWrapping;

return texture;
fork icon3
star icon7
watch icon8

+ 29 other calls in file

221
222
223
224
225
226
227
228
229
230
231
232
233
	this.materials = {};
	this.materialsArray = [];
	this.nameLookup = {};


	this.side = ( this.options && this.options.side ) ? this.options.side : THREE.FrontSide;
	this.wrap = ( this.options && this.options.wrap ) ? this.options.wrap : THREE.RepeatWrapping;


};


THREE.MTLLoader.MaterialCreator.prototype = {
fork icon3
star icon6
watch icon1

+ 18 other calls in file

904
905
906
907
908
909
910
911
912
913
    t.image = scope._getRotatedImage(t.image);
    t.magFilter = three_1.NearestFilter;
    t.minFilter = three_1.NearestFilter;
}
t.flipY = false;
t.wrapS = three_1.RepeatWrapping;
t.wrapT = three_1.RepeatWrapping;
for (let i = 0; i < texture.readyCallbacks.length; i += 1) {
    texture.readyCallbacks[i](texture);
}
fork icon1
star icon3
watch icon0

+ 9 other calls in file

253
254
255
256
257
258
259
260
261
262
        const z = 0;
        data[i] = simplex.noise3d(x, y, z);
    }
    this.noiseTexture = new three_1.DataTexture(data, width, height, three_1.RedFormat, three_1.FloatType);
    this.noiseTexture.wrapS = three_1.RepeatWrapping;
    this.noiseTexture.wrapT = three_1.RepeatWrapping;
    this.noiseTexture.needsUpdate = true;
}
overrideVisibility() {
    const scene = this.scene;
fork icon1
star icon3
watch icon0

+ 11 other calls in file

204
205
206
207
208
209
210
211
212
213

// Floor
const loader = new THREE.TextureLoader()
const texture = await loader.loadAsync('/visualizer/textures/environment/checkerboard_default.jpg')

texture.wrapS = THREE.RepeatWrapping;
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set(8, 8);

const gridHelper = new THREE.InfiniteGridHelper(5, 100, new THREE.Color("white"), 100)
fork icon0
star icon7
watch icon0

+ 7 other calls in file

151
152
153
154
155
156
157
158
159
160
var waterGeometry = new THREE.PlaneBufferGeometry(100000, 100000);
var water = new Water_js_1.Water(waterGeometry, {
    textureWidth: 512,
    textureHeight: 512,
    waterNormals: new THREE.TextureLoader().load('water.jpg', function (texture) {
        texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
    }),
    sunDirection: new THREE.Vector3(),
    sunColor: 0xffffff,
    waterColor: 0x001e0f,
fork icon0
star icon3
watch icon1

+ 13 other calls in file

177
178
179
180
181
182
183
184
185
186
187
188
	this.materials = {};
	this.materialsArray = [];
	this.nameLookup = {};


	this.side = this.options && this.options.side ? this.options.side : THREE.FrontSide;
	this.wrap = this.options && this.options.wrap ? this.options.wrap : THREE.RepeatWrapping;
};


MTLLoader.MaterialCreator.prototype = {

fork icon0
star icon2
watch icon1

239
240
241
242
243
244
245
246
247
248
var uniforms = THREE.UniformsUtils.merge([THREE.ShaderLib.lambert.uniforms]),
    declare = '',
    assign = '';
for (var i = 0, l = textures.length; i < l; i++) {
    // Uniforms
    textures[i].wrapS = textures[i].wrapT = THREE.RepeatWrapping;
    textures[i].needsUpdate = true;
    uniforms['texture_' + i] = {
        type: 't',
        value: textures[i].texture,
fork icon0
star icon2
watch icon3

+ 3 other calls in file

104
105
106
107
108
109
110
111
112
'data/shot-generator/grid_wall2.png',
image => {
  wallTexture.current = new THREE.Texture()

  wallTexture.current.image = image
  wallTexture.current.wrapS = wallTexture.current.wrapT = THREE.RepeatWrapping
  wallTexture.current.offset.set( 0, 0 )
  wallTexture.current.repeat.set( 4.5, 4.5 )
  wallTexture.current.needsUpdate = true
fork icon263
star icon0
watch icon2

113
114
115
116
117
118
119
120
121
122
this.textures = null
this.texture_video = document.createElement('video')
texture.stream.then(_.bind(function(stream) {
    this.texture_video.src = window.URL.createObjectURL(stream);
    var texture = new THREE.VideoTexture(this.texture_video)
    //texture.wrapS = THREE.RepeatWrapping;
    //texture.wrapT = THREE.RepeatWrapping;
    texture.minFilter = THREE.LinearFilter;
    //texture.wrapT = THREE.RepeatWrapping;
    this.textures = [texture];
fork icon236
star icon0
watch icon2

+ 9 other calls in file

139
140
141
142
143
144
145
146
147
148
var loader = new THREE.TextureLoader();

loader.load('images/displace.jpg',(texture)=> {
  let textureDisplacement = texture;
  textureDisplacement.minFilter = textureDisplacement.magFilter = THREE.LinearFilter;
  textureDisplacement.wrapS = textureDisplacement.wrapT = THREE.RepeatWrapping;
  this.displacementPass.params.uDisplacement = textureDisplacement;
});

loader.load('images/lookup_blue.png',(texture)=> {
fork icon3
star icon6
watch icon1

1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
    9987: three.LinearMipmapLinearFilter
};
const WEBGL_WRAPPINGS = {
    33071: three.ClampToEdgeWrapping,
    33648: three.MirroredRepeatWrapping,
    10497: three.RepeatWrapping
};
const WEBGL_TYPE_SIZES = {
    'SCALAR': 1,
    'VEC2': 2,
fork icon2
star icon7
watch icon0

+ 2 other calls in file

182
183
184
185
186
187
188
189
190
191

set_source_image("37");

material.map.wrapS = THREE.RepeatWrapping;
material.roughnessMap.wrapS = THREE.RepeatWrapping;
material.metalnessMap.wrapS = THREE.RepeatWrapping;
material.normalMap.wrapS = THREE.RepeatWrapping;
material.side = THREE.DoubleSide;

group.traverse( function ( child ) {
fork icon1
star icon0
watch icon1

+ 15 other calls in file

Other functions in three

Sorted by popularity

function icon

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