问题
I'm trying to wrap a texture for the floor, but it doesn't work - the texture is not repeated 5 times as it should be. Here s the code I used:
var floorTexture = new THREE.ImageUtils.loadTexture( 'textures/floor.jpg' );
floorTexture.wrapS = floorTexture.wrapT = THREE.RepeatWrapping;
floorTexture.repeat.set( 5, 1 );
var floorMaterial = new THREE.MeshPhongMaterial( { map: floorTexture, side: THREE.DoubleSide } );
var floorGeometry = new THREE.PlaneGeometry( 45, 44.5 );
var floor = new THREE.Mesh( floorGeometry, floorMaterial );
You can see the project here : http://provasitimek.herobo.com/Tesi9.2/ - choose the userGroup, then the paths, the startPoint end the endPoint to visit the model
回答1:
You have to make sure that your texture has sizes which are power of two.
Generally WebGL does not support NPOT (non-power of two) textures. There are some exceptions though outlined at Non power of two textures
来源:https://stackoverflow.com/questions/26100481/texture-wrapping-is-not-repeating-as-it-should-be