How to use the CatmullRomCurve3 function from three

Find comprehensive JavaScript three.CatmullRomCurve3 code examples handpicked from public code repositorys.

48
49
50
51
52
53
54
55
56
57
    }
});

    //// curve
    stauff.curveUp = new THREE.CatmullRomCurve3( stauff.controlPointsUp );
    stauff.curveDown = new THREE.CatmullRomCurve3( stauff.controlPointsDown )
    
    var curve = new THREE.CatmullRomCurve3( stauff.controlPointsUp );
    var geometry = new THREE.Geometry();
    geometry.vertices = stauff.curveUp.getPoints( 50 );
fork icon31
star icon0
watch icon2

+ 63 other calls in file

38
39
40
41
42
43
44
45
46
47
  options: optionsDefault
})
let { options } = parsedArgs
this.options = options
let { shape, divisions } = options
let extrudePath = new THREE.CatmullRomCurve3(points)
if (shape === 'circle') {
  shape = circleShape(options.radius, options.shapeDivisions)
}
let extrudeSettings = {
fork icon0
star icon5
watch icon3

3
4
5
6
7
8
9
10
11
12
require('./lines/LineMaterial.js')
require('./lines/Line2.js')
const line3DGeometry = function (points, color, divisions = 1) {
  let positions = []
  let colors = []
  let spline = new THREE.CatmullRomCurve3(points)

  for (let i = 0, l = points.length * divisions; i < l; i++) {
    let point = spline.getPoint(i / l)
    positions.push(point.x, point.y, point.z)
fork icon0
star icon5
watch icon3

+ 7 other calls in file

36
37
38
39
40
41
42
43
44
        var splineArr = [];
        for ( var i=1; i<=totalPoints; i++){
                splineArr.push ( myCurve.getPoint( totalPoints/i ) );
        }

        this.spline = new THREE.CatmullRomCurve3( splineArr );
        this.setLinesGlow ( this.spline , 50);
};

fork icon0
star icon7
watch icon1

+ 3 other calls in file

154
155
156
157
158
159
160
161
162
163
controls.target.set(0, 0, 0);
controls.rotateSpeed = 0.3;
controls.zoomSpeed = 1.0;
controls.panSpeed = 2.0;

var pipeSpline = new THREE.CatmullRomCurve3( [
    new THREE.Vector3( 0, 10, -10 ), new THREE.Vector3( 10, 0, -10 ),
    new THREE.Vector3( 20, 0, 0 ), new THREE.Vector3( 30, 0, 10 ),
    new THREE.Vector3( 30, 0, 20 ), new THREE.Vector3( 20, 0, 30 ),
    new THREE.Vector3( 10, 0, 30 ), new THREE.Vector3( 0, 0, 30 ),
fork icon14
star icon4
watch icon0

+ 11 other calls in file

21
22
23
24
25
26
27
28
29
30
const points = [];
for (let i = -5; i < 5; i += 1) {
  points.push(new THREE.Vector3(0, -Math.pow(i * 1.5, 2), 25 * i));
}

const curve = new THREE.CatmullRomCurve3(points);
const geometry = new THREE.TubeBufferGeometry(curve, 100, 14, 100, false);
const material = new THREE.MeshStandardMaterial({
  color: 'lightblue',
  side: THREE.DoubleSide,
fork icon0
star icon0
watch icon0

51
52
53
54
55
56
57
58
59
60
// geoBodyMarker.translate(0, 0, 0)
groupSkeleton.add(meshBodyMarker)

// upper body

let pointsUpperBody = new THREE.CatmullRomCurve3([
  new THREE.Vector3(0, 10, -10), new THREE.Vector3(10, 0, -10),
  new THREE.Vector3(20, 0, 0), new THREE.Vector3(30, 0, 10),
  new THREE.Vector3(30, 0, 20), new THREE.Vector3(20, 0, 30), new THREE.Vector3(10, 0, 0),
  new THREE.Vector3(10, 20, 0)
fork icon0
star icon0
watch icon3

+ 5 other calls in file

49
50
51
52
53
54
55
56
57
  previousPoint.z = randomZ

  this.points.push(new THREE.Vector3(randomX, randomY, randomZ))
}

this.spline = new THREE.CatmullRomCurve3(this.points)
for (var i = (1/500); i < 1; i+= (1/500)) {
  this.pointsPerTunnel.push(this.spline.getPointAt(i))
}
fork icon0
star icon0
watch icon9

Other functions in three

Sorted by popularity

function icon

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