| | |
| | | */ |
| | | function Route(option) { |
| | | let curvePoints=[]; |
| | | for(let i=0;i<option.points.length;i++) { |
| | | let point=option.points[i]; |
| | | curvePoints.push(new THREE.Vector3(point.x, point.y, point.z)); |
| | | } |
| | | return new THREE.CatmullRomCurve3(curvePoints,false/*是否闭合*/,'catmullrom',0.000000001); |
| | | // 1.去取货 ------------------------------------------------------------------------ |
| | | // z轴 |
| | | curvePoints.push(option[0]); |
| | | curvePoints.push({ |
| | | x: option[0].x, |
| | | y: option[0].y, |
| | | z: option[1].z |
| | | }); |
| | | return new THREE.CatmullRomCurve3(curvePoints,false,'catmullrom',0.000000001); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 2. |
| | | |
| | | |
| | | // let curvePoints=[]; |
| | | // for(let i=0;i<option.points.length;i++) { |
| | | // let point=option.points[i]; |
| | | // curvePoints.push(new THREE.Vector3(point.x, point.y, point.z)); |
| | | // } |
| | | // return new THREE.CatmullRomCurve3(curvePoints,false/*是否闭合*/,'catmullrom',0.000000001); |
| | | } |