Capítulo 361 de 859

Chapter 361: QuadraticBezierCurve

Core Idea

A curve representing a 2D Quadratic Bezier curve.

Key Concepts

  • isQuadraticBezierCurve : boolean (readonly): This flag can be used for type testing.
  • v0 : Vector2: The start point.
  • v1 : Vector2: The control point.
  • v2 : Vector2: The end point.

Code Examples

const curve = new THREE.QuadraticBezierCurve(
	new THREE.Vector2( - 10, 0 ),
	new THREE.Vector2( 20, 15 ),
	new THREE.Vector2( 10, 0 )
)
const points = curve.getPoints( 50 );
const geometry = new THREE.BufferGeometry().setFromPoints( points );
const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
// Create the final object to add to the scene
const curveObject = new THREE.Line( geometry, material );
  • What it demonstrates: Typical usage of QuadraticBezierCurve.

Reference Tables

Constructor

Signature
new QuadraticBezierCurve( v0 : Vector2, v1 : Vector2, v2 : Vector2 )

Properties

PropertyDescription
.isQuadraticBezierCurve : boolean (readonly)This flag can be used for type testing.
.v0 : Vector2The start point.
.v1 : Vector2The control point.
.v2 : Vector2The end point.

Methods

MethodDescription
.getPoint( t : number, optionalTarget : Vector2 ) : Vector2Returns a point on the curve.

Key Takeaways

  1. QuadraticBezierCurve extends: Curve
  2. Most relevant properties: isQuadraticBezierCurve, v0, v1, v2.
  3. Key methods: getPoint.

Connects To