| | |
| | | this.initStats(); |
| | | this.initLight(); |
| | | this.initFloor(); |
| | | // this.initModel(); |
| | | this.initModel(); |
| | | } |
| | | this.animate = function () { |
| | | requestAnimationFrame(this.animate.bind(this)); |
| | |
| | | // 纵横比aspect:全屏,使用的是浏览器的宽度/高度 |
| | | //近平面near:0.1 |
| | | //远平面视角far: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); |
| | | /* |
| | | 设置相机位置,注意threejs中的坐标系采用的是右手坐标系 |
| | | */ |
| | |
| | | "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++) { |
| | |
| | | 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) { |
| | |
| | | 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]; |