原始贴图:
实现效果:
//cube uv贴图
var cubeMaterial=new THREE.MeshPhongMaterial({map:THREE.ImageUtils.loadTexture('./img/building.jpg')});
let cubesizex=5.6225;
let cubesizey=3;
let cubesizez=4.2554; //计算的图片比例,为使图片不拉伸
var cubeGeometry = new THREE.BoxGeometry(cubesizex,cubesizey,cubesizez);
cubeGeometry.faceVertexUvs[0] = [];
let topnormal=new THREE.Vector3(0,-1,0);
let bottomnormal=new THREE.Vector3(0,1,0);
let fontnormal=new THREE.Vector3(0,0,1);
let backnormal=new THREE.Vector3(0,0,-1);
let letfnormal=new THREE.Vector3(1,0,0);
let rightnormal=new THREE.Vector3(-1,0,0);
let siglev=1;
let sigleu=1/51