问题
I'm trying to repeat a 16x16 texture on a plane, but when I set the texture to repeat I get the following result:
The texture is shown correctly in the bottom left of the plane, but it looks as though the top and right edges are stretched across the rest of the plane. So far I've been unable to find out why it does this.
This is the code:
function addTerrain(){
var texture = THREE.ImageUtils.loadTexture( "tex/tex.png" );
texture.WrapS = texture.WrapT = THREE.RepeatWrapping;
texture.repeat.set(2,2);
geometry = new THREE.PlaneGeometry(128, 128);
material = new THREE.MeshLambertMaterial( { map: texture } );
terrain = new THREE.Mesh( geometry, material );
terrain.rotation.set(-90 * (Math.PI / 180),0,0);
scene.add(terrain);
camera.lookAt(terrain.position);
light = new THREE.PointLight();
light.position.set(0,100,0);
scene.add(light);
}
How do I make the texture repeat across the plane properly?
来源:https://stackoverflow.com/questions/15587333/three-js-texture-not-repeating-properly