From cc6d5f5fb6bbb23e88a95752a6e5265323d1c7d9 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期五, 17 十二月 2021 09:00:03 +0800
Subject: [PATCH] #

---
 static/js/object/StoreShelf.js |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/static/js/object/StoreShelf.js b/static/js/object/StoreShelf.js
index 3591c4a..3d093b3 100644
--- a/static/js/object/StoreShelf.js
+++ b/static/js/object/StoreShelf.js
@@ -1,4 +1,4 @@
-function StoreShelf0(option) {
+function StoreShelf(option) {
     this.binLength = option.binLength||50;//搴撲綅闀垮害
     this.binWidth = option.binWidth||50;//搴撲綅瀹�
     this.binHeight = option.binHeight||50;//搴撲綅楂�
@@ -13,12 +13,16 @@
     this.rackWidth = 3;//鏀灦鐨勫搴︼紝榛樿璁惧畾涓�3
 
     // 鏉愯川
-    let shelfMat = new THREE.MeshLambertMaterial({color:0x175EC0});//瀹氫箟鏀灦鍜屾墭鐩樼殑鏉愯川
+    let shelfMat = new THREE.MeshLambertMaterial({
+        color: 0x175EC0,
+        transparent: true,
+        opacity: .2
+    });//瀹氫箟鏀灦鍜屾墭鐩樼殑鏉愯川
     //瀹氫箟涓�涓粍鍚堜綋
     let group = new THREE.Group();
 
     // 璐ф灦鎬婚珮
-    let shelfHeight=this.bottomHight+(this.binYNum-1)*this.binHeight;
+    let shelfHeight=this.bottomHight+(this.binYNum)*this.binHeight;
     // 璐ф灦鎬诲
     let shelfWidth=this.binZNum*this.binWidth;
     // 鏀灦妯″瀷 + 鏉愯川
@@ -39,7 +43,7 @@
     // 鍒濆鍖栨敮鏋舵ā鍨�
     for(let i=0;i<=this.binZNum;i++) {
         let leftRack = rackObject.clone();
-        let positionZ = this.positionZ - shelfWidth/2 + i*this.binWidth;
+        let positionZ = - ( this.positionZ + i*this.binWidth );
         leftRack.position.set(leftPositionX,positionY,positionZ);
         leftRack.updateMatrix();
         group.add(leftRack);
@@ -51,10 +55,10 @@
     }
     // 鍒濆鍖栨墭鏉挎ā鍨�
     for(let i = 0;i < this.binZNum;i++) {
-        for (let j = 0;j < this.binYNum;j++) {
+        for (let j = 0;j <= this.binYNum;j++) {
             let plane = planeObject.clone();
             let positionY= this.positionY + this.bottomHight + j*this.binHeight + 1;
-            let positionZ= this.positionZ - shelfWidth/2 + i * this.binWidth + this.binWidth/2;
+            let positionZ= - ( this.positionZ + i * this.binWidth + this.binWidth/2 );
             plane.position.set(this.positionX-this.rackLengh/2,positionY,positionZ);
             plane.updateMatrix();
             group.add(plane);

--
Gitblit v1.9.1