From d46eabb8810488271c3641825a21601631429f99 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期五, 26 十一月 2021 09:39:46 +0800 Subject: [PATCH] # --- static/js/app.js | 45 +++++++++++++++++++++++++++++++++++++++------ 1 files changed, 39 insertions(+), 6 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index 88fc6cb..70f8577 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -28,7 +28,7 @@ this.initStats(); this.initLight(); this.initFloor(); - // this.initModel(); + this.initModel(); } this.animate = function () { requestAnimationFrame(this.animate.bind(this)); @@ -46,7 +46,7 @@ // 绾垫í姣攁spect:鍏ㄥ睆锛屼娇鐢ㄧ殑鏄祻瑙堝櫒鐨勫搴�/楂樺害 //杩戝钩闈ear锛�0.1 //杩滃钩闈㈣瑙抐ar:10000 - this.camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 10000); + this.camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 50000); /* 璁剧疆鐩告満浣嶇疆锛屾敞鎰弔hreejs涓殑鍧愭爣绯婚噰鐢ㄧ殑鏄彸鎵嬪潗鏍囩郴 */ @@ -131,7 +131,7 @@ "posy.jpg", "negy.jpg", "posz.jpg", "negz.jpg" ]); - // this.scene.background = new THREE.Color( 0xf0f0f0 ); + this.scene.background = new THREE.Color( 0xf0f0f0 ); } this.removeObject = function (nameorid) { for (let i = 0; i < this.objects.length; i++) { @@ -195,11 +195,44 @@ new OBJLoader( manager ) .setMaterials( materials ) .setPath( '../static/model/obj/' ) - .load( 'AGV.obj', function ( object ) { - object.position.y = 0; + .load( '璐у弶.obj', function ( object ) { + object.position.z = -500; + object.position.x = -1560; + object.scale.set(0.025, 0.025, 0.025); + object.rotateY(- Math.PI / 2) that.addObject( object ); }, null, null ); }); + new MTLLoader(manager) + .setPath( '../static/model/obj/' ) + .load( '杞借揣鍙�.mtl', function ( materials ) { + materials.preload(); + new OBJLoader( manager ) + .setMaterials( materials ) + .setPath( '../static/model/obj/' ) + .load( '杞借揣鍙�.obj', function ( object ) { + object.position.z = -500; + object.position.x = -1560; + object.scale.set(0.025, 0.025, 0.025); + object.rotateY(- Math.PI / 2) + that.addObject( object ); + }, null, null ); + }); + new MTLLoader(manager) + .setPath( '../static/model/obj/' ) + .load( '鍫嗗灈鏈烘湰浣�.mtl', function ( materials ) { + materials.preload(); + new OBJLoader( manager ) + .setMaterials( materials ) + .setPath( '../static/model/obj/' ) + .load( '鍫嗗灈鏈烘湰浣�.obj', function ( object ) { + object.position.z = -500; + object.position.x = -1560; + object.scale.set(0.025, 0.025, 0.025); + object.rotateY(- Math.PI / 2) + that.addObject( object ); + }, null, null ); + }); } this.initStoreObjects = function (object) { if (this.firstTime === 1) { @@ -214,7 +247,7 @@ let optionStore = optionArea.Stores[j]; optionStore.Position = CommonFunction.transPosition(optionStore.Position, optionArea.Position); let store = new Store(optionStore); - object.addObject(store); + // object.addObject(store); //鏄剧ず姣忚淇℃伅 for (let k = 0; k < optionStore.Groups.length; k++) { let optionGroup = optionStore.Groups[k]; -- Gitblit v1.9.1