#
luxiaotao1123
2022-01-05 148cb14e6d98da7953d63d39969d95d099cac8bd
#
1个文件已修改
48 ■■■■■ 已修改文件
static/js/object/StoreGoods.js 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/StoreGoods.js
@@ -21,36 +21,30 @@
    }
    const manager = new THREE.LoadingManager();
    new MTLLoader(manager)
    new OBJLoader( manager )
        .setPath( '../static/model/obj/' )
        .load( 'pallet.mtl', function ( materials ) {
            materials.preload();
            new OBJLoader( manager )
                .setMaterials( materials )
                .setPath( '../static/model/obj/' )
                .load( 'pallet.obj', function ( obj ) {
                    obj.traverse (function (child) {
                        child.castShadow = true;
                        if (child instanceof THREE.Mesh) {
                            child.material = new THREE.MeshLambertMaterial({
                                color: 0x708090
                            });
                        }
        .load( 'pallet.obj', function ( obj ) {
            obj.traverse (function (child) {
                child.castShadow = true;
                if (child instanceof THREE.Mesh) {
                    child.material = new THREE.MeshLambertMaterial({
                        color: 0x708090
                    });
                    obj.scale.set(4, 4, 3.5);
                }
            });
            obj.scale.set(4, 4, 3.5);
                    palletList.map(item => {
                        let clone = obj.clone();
                        let positionX = that.shelf.positionX || 0;
                        let positionY = that.shelf.bottomHight + (item.lev1-1)*that.shelf.binHeight || 0;
                        let positionZ = (item.bay1-1)*-that.shelf.binHeight || 0;
            palletList.map(item => {
                let clone = obj.clone();
                let positionX = that.shelf.positionX || 0;
                let positionY = that.shelf.bottomHight + (item.lev1-1)*that.shelf.binHeight || 0;
                let positionZ = (item.bay1-1)*-that.shelf.binHeight || 0;
                        clone.position.x = -18 + positionX;
                        clone.position.y = 2 + positionY;
                        clone.position.z = -46 + positionZ;
                        that.object.addObject(clone);
                    })
                }, null, null );
                clone.position.x = -18 + positionX;
                clone.position.y = 2 + positionY;
                clone.position.z = -46 + positionZ;
                that.object.addObject(clone);
            })
        });
    const goodsWrapImg = new THREE.TextureLoader( manager ).load( '../static/img/goodsWrap.jpg' );
@@ -76,7 +70,7 @@
            clone.position.x = -17 + positionX;
            clone.position.y = 5 + positionY;
            clone.position.z = -7 + positionZ;
            clone.position.z = -6 + positionZ;
            that.object.addObject(clone);
        })
    });