How to use the CubicBezierCurve3 function from three
Find comprehensive JavaScript three.CubicBezierCurve3 code examples handpicked from public code repositorys.
GitHub: bostelk/hedron
8 9 10 11 12 13 14 15 16 17
// const cubeMaterial = new MeshBasicMaterial({ wireframe: true }) // const blockHelper = new Mesh(cubeGeom, cubeMaterial) this.geom = new Geometry() const createBend = (prevDir, nextDir) => { const bendCurve = new CubicBezierCurve3( new Vector3(-prevDir[0] * blockSize / 2, -prevDir[1] * blockSize / 2, -prevDir[2] * blockSize / 2), new Vector3(0, 0, 0), new Vector3(0, 0, 0), new Vector3(nextDir[0] * blockSize / 2, nextDir[1] * blockSize / 2, nextDir[2] * blockSize / 2)
21
0
1
+ 3 other calls in file
67 68 69 70 71 72 73 74 75
); // make curve segments const listToVector3 = (coords) => (new THREE.Vector3(...coords)); const curveSegments = bezierSpline.getSegments(bezierPoints) .map((segment) => (new THREE.CubicBezierCurve3( ...segment.map(listToVector3) )) );
2
20
2
134 135 136 137 138 139 140 141 142 143
} }).bind(this) }); this.firstPath = new THREE.CubicBezierCurve3( new THREE.Vector3( 1.0000, -1.0000, 0 ), new THREE.Vector3( 1.0000, 1.7000, 0 ), new THREE.Vector3( -3.5500, 1.7500, 0 ), new THREE.Vector3( -15.5000, 0.7700, 0 )
0
0
2
+ 5 other calls in file
100 101 102 103 104 105 106 107 108 109
tboxMatrix.makeTranslation( 6.36396,29.2635, 0); tboxMatrix.multiply( new THREE.Matrix4().makeRotationZ( -Math.PI/4 ) ); this.rightInteraction.applyMatrix( tboxMatrix ); // Left and right camera paths this.pathLeft = new THREE.CubicBezierCurve3( new THREE.Vector3( 0.0000, 0.00000, 0 ), new THREE.Vector3( 0.0000, 22.0000, 0 ), new THREE.Vector3( 0.0000, 22.0000, 0 ), new THREE.Vector3( -19.0919, 41.9914, 0 )
0
0
2
+ 3 other calls in file
167 168 169 170 171 172 173 174 175 176
podium.children[0].material = this.podiumMaterial; podium.children[1].material = this.podiummessageMaterial; this.add(podium); // Prepare the enter and leave paths this.pathEnter = new THREE.CubicBezierCurve3( new THREE.Vector3( 0.0000, 1.00000, 0 ), new THREE.Vector3( 0.0000, 2.00000, 0 ), new THREE.Vector3( 0.0000, podium.position.y-3, 0.0 ), new THREE.Vector3( 0.0000, podium.position.y-2, 0.0 )
0
0
2
+ 3 other calls in file
three.Vector3 is the most popular function in three (22341 examples)