#
luxiaotao1123
2021-12-11 5b941c4a6c6c6b494f65486ca87c46c978cb53e1
#
2个文件已修改
40 ■■■■■ 已修改文件
static/js/app.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/object/StoreCrn.js 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/app.js
@@ -57,7 +57,7 @@
            // this.camera.position.z = 600;
            // //相机的朝向
            // this.camera.lookAt(0, 0, 0);
            this.camera.position.set( - 550, 2070, 4550 );
            this.camera.position.set( - 350, 1070, 1550 );
            this.camera.lookAt( this.scene.position );
            //将相机放到场景中
            this.scene.add(this.camera);
static/js/object/StoreCrn.js
@@ -1,38 +1,44 @@
function StoreCrn(option, object) {
    console.log(option);
    this.crnLength = option.crnBody.length||50;//库位长度
    this.crnWidth = option.crnBody.width||50;//库位宽
    this.crnHeight = option.crnBody.height||500;//库位高
    this.crnBodyLength = option.crnBody.length||50;//库位长度
    this.crnBodyWidth = option.crnBody.width||50;//库位宽
    this.crnBodyHeight = option.crnBody.height||500;//库位高
    this.crnLoadLength = option.crnLoad.length||60;//库位长度
    this.crnLoadWidth = option.crnLoad.width||60;//库位宽
    this.crnLoadHeight = option.crnLoad.height||40;//库位高
    this.crnForkLength = option.crnFork.length||80;//库位长度
    this.crnForkWidth = option.crnFork.width||20;//库位宽
    this.crnForkHeight = option.crnFork.height||30;//库位高
    // 立柱
    var a = new THREE.Mesh(new THREE.BoxBufferGeometry(this.crnLength, this.crnHeight, this.crnWidth), new THREE.MeshBasicMaterial({
        color: 0x00ffff,
    var a = new THREE.Mesh(new THREE.BoxBufferGeometry(this.crnBodyLength, this.crnBodyHeight, this.crnBodyWidth), new THREE.MeshBasicMaterial({
        color: 0xff0000,
        transparent: true,
        opacity: .8
        opacity: .3
    }))
    a.position.x = option.crnBody.position.x;
    a.position.y = option.crnBody.position.y + this.crnHeight/2;
    a.position.z = option.crnBody.position.z - this.crnWidth/2;
    a.position.y = option.crnBody.position.y + this.crnBodyHeight/2;
    a.position.z = option.crnBody.position.z - this.crnBodyWidth/2;
    object.addObject(a);
    // 载货台
    var b = new THREE.Mesh(new THREE.BoxBufferGeometry(10,10,10), new THREE.MeshBasicMaterial({
        color: 0x0000ff,
    var b = new THREE.Mesh(new THREE.BoxBufferGeometry(this.crnLoadLength, this.crnLoadHeight, this.crnLoadWidth), new THREE.MeshBasicMaterial({
        color: 0x00ff00,
        transparent: true,
        opacity: 1
        opacity: .5
    }))
    b.position.x = option.crnLoad.position.x;
    b.position.y = 0;
    b.position.z = 0;
    b.position.y = option.crnLoad.position.y + this.crnLoadHeight/2;
    b.position.z = option.crnLoad.position.z - this.crnLoadWidth/2 + 5;
    object.addObject(b);
    // 叉牙
    var c = new THREE.Mesh(new THREE.BoxBufferGeometry(5,5,5), new THREE.MeshBasicMaterial({
    var c = new THREE.Mesh(new THREE.BoxBufferGeometry(this.crnForkLength, this.crnForkWidth, this.crnForkHeight), new THREE.MeshBasicMaterial({
        color: 0xff00ff,
        transparent: true,
        opacity: 1
    }))
    c.position.x = option.crnFork.position.x;
    c.position.y = 0;
    c.position.z = 0;
    c.position.y = option.crnFork.position.y + this.crnLoadHeight/2;
    c.position.z = option.crnFork.position.z - this.crnLoadWidth/2;
    object.addObject(c);
}