From ce233f75205501532c91fb2fdf0ca1a3f1dbb442 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@63.com> Date: 星期一, 13 十二月 2021 14:19:43 +0800 Subject: [PATCH] # --- static/js/object/Route.js | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) diff --git a/static/js/object/Route.js b/static/js/object/Route.js index b27209b..92a4274 100644 --- a/static/js/object/Route.js +++ b/static/js/object/Route.js @@ -12,9 +12,27 @@ */ 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); } -- Gitblit v1.9.1