#
luxiaotao1123
2021-12-17 c1a770f7d71370878bc3d28f5248881b698d7718
static/js/object/StoreShelf.js
@@ -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);