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;
183
861
0
+ 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;
15
120
9
+ 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); } /**
8
63
0
GitHub: mattdesl/filmic-gl
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;
2
51
7
+ 3 other calls in file
GitHub: namel/veri
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
3
20
5
GitHub: mattdesl/xmas
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
2
16
2
+ 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,
2
10
0
+ 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;
3
7
8
+ 29 other calls in file
GitHub: 52black/scratch-vm
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 = {
3
6
1
+ 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); }
1
3
0
+ 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;
1
3
0
+ 11 other calls in file
GitHub: ASLS-org/studio
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)
0
7
0
+ 7 other calls in file
GitHub: 4MOR3/three-background
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,
0
3
1
+ 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 = {
0
2
1
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,
0
2
3
+ 3 other calls in file
GitHub: KleoPetroff/storyboarder
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
263
0
2
GitHub: vidartf/ipyvolume
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];
236
0
2
+ 9 other calls in file
GitHub: JordanMachado/fluctus
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)=> {
3
6
1
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,
2
7
0
+ 2 other calls in file
GitHub: utunga/deeppbr.ai
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 ) {
1
0
1
+ 15 other calls in file
three.Vector3 is the most popular function in three (22341 examples)