|
@@ -125,10 +125,10 @@ export default {
|
|
|
var that = this;
|
|
|
console.log("草地模型加载成功",list)
|
|
|
//将模型添加到场景中
|
|
|
- // let texture = new THREE.TextureLoader().load( "https://dm.static.elab-plus.com/miniProgram/T_GLTF_MI_Uncut_Grass_oilpt20_2K_BaseColor.jpg");
|
|
|
+ let texture = new THREE.TextureLoader().load( "https://dm.static.elab-plus.com/miniProgram/grass.jpg");
|
|
|
// let texture = new THREE.TextureLoader().load( "https://dm.static.elab-plus.com/miniProgram/Avatar_male.png" );
|
|
|
- // texture.wrapS = THREE.RepeatWrapping;
|
|
|
- // texture.wrapT = THREE.RepeatWrapping;
|
|
|
+ texture.wrapS = THREE.RepeatWrapping;
|
|
|
+ texture.wrapT = THREE.RepeatWrapping;
|
|
|
|
|
|
list && list.forEach(obj=>{
|
|
|
let positionX = obj.centerX / 100;
|
|
@@ -136,9 +136,10 @@ export default {
|
|
|
let scaleX = obj.spaceWidth / 100;
|
|
|
let scaleY = obj.spaceHeight / 100;
|
|
|
|
|
|
- let texture = new THREE.TextureLoader().load( "https://dm.static.elab-plus.com/miniProgram/grass.jpg");
|
|
|
- texture.wrapS = THREE.RepeatWrapping;
|
|
|
- texture.wrapT = THREE.RepeatWrapping;
|
|
|
+ texture = texture.clone();
|
|
|
+ // let texture = new THREE.TextureLoader().load( "https://dm.static.elab-plus.com/miniProgram/grass.jpg");
|
|
|
+ // texture.wrapS = THREE.RepeatWrapping;
|
|
|
+ // texture.wrapT = THREE.RepeatWrapping;
|
|
|
//使用纹理贴图材质
|
|
|
texture.repeat.set(scaleX, scaleY);
|
|
|
|
|
@@ -146,7 +147,7 @@ export default {
|
|
|
let material = new THREE.MeshBasicMaterial({ map: texture });
|
|
|
let cube = new THREE.Mesh(geometry, material);
|
|
|
|
|
|
- cube.name= "地板";
|
|
|
+ cube.name = "地板";
|
|
|
cube.userType = "mesh";
|
|
|
cube.userData = obj;//位置数据
|
|
|
// 设置位置,旋转,缩放
|