How to use the SplineCurve function from three
Find comprehensive JavaScript three.SplineCurve code examples handpicked from public code repositorys.
36 37 38 39 40 41 42 43 44 45
createSpline(e) { const curveSegmentsAmount = e.detail.nextCurveSegmentsAmount || this.defaultCurveSegmentsAmount; const splineCoords = e.detail.points || this.defaultSplinePoints.slice(); const curve = new THREE.SplineCurve(splineCoords); const path = new THREE.Path(curve.getPoints(curveSegmentsAmount)); const geometry = path.createPointsGeometry(curveSegmentsAmount); const splineMesh = new THREE.Line(geometry, lineMaterial); splineMesh.rotation.x = Math.PI / 2;
0
1
2
+ 3 other calls in file
5 6 7 8 9 10 11 12 13 14
//var levelOfDetail = 50; var feathers = new THREE.Object3D(); var feathersLayer2 = new THREE.Object3D(); var feathersLayer3 = new THREE.Object3D(); var splineObject = new THREE.Line(); var curve = new THREE.SplineCurve( [ new THREE.Vector2( 1, 0 ), new THREE.Vector2( -0.5, -0.6 ), new THREE.Vector2( -2, 0 ), new THREE.Vector2( -2.5, 0 )
31
0
2
+ 3 other calls in file
GitHub: P79N6A/cy3d
157 158 159 160 161 162 163 164 165 166
sphere.position.set(posInfo.x, posInfo.y, posInfo.z) this.objArray.push(sphere) pointArr.push(new THREE.Vector2(posInfo.x, posInfo.y)) }) const curve = new THREE.SplineCurve(pointArr) const path = new THREE.Path(curve.getPoints(5000)) const lineGeometry = path.createPointsGeometry(5000) const lineMaterial = new THREE.LineBasicMaterial({ color: colors[item.value.index%colors.length],
0
0
0
+ 3 other calls in file
three.Vector3 is the most popular function in three (22341 examples)