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;
fork icon0
star icon1
watch icon2

+ 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 )
fork icon31
star icon0
watch icon2

+ 3 other calls in file

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],
fork icon0
star icon0
watch icon0

+ 3 other calls in file

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)