刚学、这个鸟玩意儿卡了半天,记录一下。
var skyBox = new THREE.Mesh(skyGeometry, skyMaterial); //创建一个完整的天空盒,填入几何模型和材质的参数
skyBox.name = "box1";
skyBox.position.set(0, 0, 0);
skyBox.scale.x = -1 ////////////////////////
this.scene.add(skyBox); //在场景中加入天空盒
左右翻转:
cylinder.scale.x = -1;
var materialArray = []; for (var i = 0; i < 6; i++) { var texture = new THREE.TextureLoader().load(this.urls[i], () => { this.loading += 1; //加载进度 if (this.loading == 6) { this.loadingindex = false; } }); // texture.flipY = false //上下翻转 materialArray.push( new THREE.MeshBasicMaterial({ map: texture, //将图片纹理贴上 side: THREE.BackSide, }) ); }
上下翻转:
texture.flipY = false //默认true