#
luxiaotao1123
2021-12-13 4b3467e05cb0e2b68bc3e8ef08827e9e874562c8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
 *  points:[
     {x:-100,y:1,z:50},
     {x:-500,y:1,z:50},
     {x:-800,y:1,z:50},
     {x:-800,y:1,z:420},
     {x:-1400,y:1,z:420},
     {x:-1400,y:1,z:480},
     {x:-100,y:1,z:480},
     {x:-100,y:1,z:50}
    ]
 */
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);
}