From 5b941c4a6c6c6b494f65486ca87c46c978cb53e1 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期六, 11 十二月 2021 15:12:21 +0800 Subject: [PATCH] # --- static/js/object/StoreCrn.js | 38 ++++++++++++++++++++++---------------- 1 files changed, 22 insertions(+), 16 deletions(-) diff --git a/static/js/object/StoreCrn.js b/static/js/object/StoreCrn.js index a55f268..e37d9eb 100644 --- a/static/js/object/StoreCrn.js +++ b/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); } -- Gitblit v1.9.1