This commit is contained in:
蔡玲
2024-12-04 10:21:04 +08:00
parent 9d776c65e9
commit c1ac42072f
4042 changed files with 2293732 additions and 1185 deletions

View File

@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr; [page:EllipseCurve] &rarr;
<h1>[name]</h1>
<p class="desc">Alias for [page:EllipseCurve].</p>
<h2>Properties</h2>
<p>See the [page:EllipseCurve] class for common properties.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>

View File

@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr;
<h1>[name]</h1>
<p class="desc">Create a smooth 3d spline curve from a series of points using the
[link:https://en.wikipedia.org/wiki/Centripetal_Catmull-Rom_spline Catmull-Rom] algorithm.</p>
<h2>Code Example</h2>
<code>
//Create a closed wavey loop
const curve = new THREE.CatmullRomCurve3( [
new THREE.Vector3( -10, 0, 10 ),
new THREE.Vector3( -5, 5, 5 ),
new THREE.Vector3( 0, 0, 0 ),
new THREE.Vector3( 5, -5, 5 ),
new THREE.Vector3( 10, 0, 10 )
] );
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 );
</code>
<h2>Examples</h2>
<p>
[example:webgl_geometry_extrude_splines WebGL / geometry / extrude / splines]
</p>
<h2>Constructor</h2>
<h3>[name]( [param:Array points], [param:Boolean closed], [param:String curveType], [param:Float tension] )</h3>
<p>
points An array of [page:Vector3] points<br/>
closed Whether the curve is closed. Default is *false*.<br/>
curveType Type of the curve. Default is *centripetal*.<br/>
tension Tension of the curve. Default is *0.5*.
</p>
<h2>Properties</h2>
<p>See the base [page:Curve] class for common properties.</p>
<h3>[property:Array points]</h3>
<p>The array of [page:Vector3] points that define the curve. It needs at least two entries.</p>
<h3>[property:Boolean closed]</h3>
<p>The curve will loop back onto itself when this is true.</p>
<h3>[property:String curveType]</h3>
<p>Possible values are *centripetal*, *chordal* and *catmullrom*.</p>
<h3>[property:Float tension]</h3>
<p>When [page:.curveType] is *catmullrom*, defines catmullrom's tension.</p>
<h2>Methods</h2>
<p>See the base [page:Curve] class for common methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>

View File

@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr;
<h1>[name]</h1>
<p class="desc">
Create a smooth 2d
<a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:Bezier_curve.svg" target="_blank">cubic bezier curve</a>,
defined by a start point, endpoint and two control points.
</p>
<h2>Code Example</h2>
<code>
const curve = new THREE.CubicBezierCurve(
new THREE.Vector2( -10, 0 ),
new THREE.Vector2( -5, 15 ),
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 );
</code>
<h2>Constructor</h2>
<h3>[name] ( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2], [param:Vector2 v3] )</h3>
<p>
[page:Vector2 v0] The starting point.<br/>
[page:Vector2 v1] The first control point.<br/>
[page:Vector2 v2] The second control point.<br/>
[page:Vector2 v3] The ending point.
</p>
<h2>Properties</h2>
<p>See the base [page:Curve] class for common properties.</p>
<h3>[property:Vector2 v0]</h3>
<p>The starting point.</p>
<h3>[property:Vector2 v1]</h3>
<p>The first control point.</p>
<h3>[property:Vector2 v2]</h3>
<p>The second control point.</p>
<h3>[property:Vector2 v3]</h3>
<p>The ending point.</p>
<h2>Methods</h2>
<p>See the base [page:Curve] class for common Methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>

View File

@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr;
<h1>[name]</h1>
<p class="desc">
Create a smooth 3d
<a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:Bezier_curve.svg" target="_blank">cubic bezier curve</a>,
defined by a start point, endpoint and two control points.
</p>
<h2>Code Example</h2>
<code>
const curve = new THREE.CubicBezierCurve3(
new THREE.Vector3( -10, 0, 0 ),
new THREE.Vector3( -5, 15, 0 ),
new THREE.Vector3( 20, 15, 0 ),
new THREE.Vector3( 10, 0, 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 );
</code>
<h2>Constructor</h2>
<h3>[name]( [param:Vector3 v0], [param:Vector3 v1], [param:Vector3 v2], [param:Vector3 v3] )</h3>
<p>
[page:Vector3 v0] The starting point.<br/>
[page:Vector3 v1] The first control point.<br/>
[page:Vector3 v2] The second control point.<br/>
[page:Vector3 v3] The ending point.
</p>
<h2>Properties</h2>
<p>See the base [page:Curve] class for common properties.</p>
<h3>[property:Vector2 v0]</h3>
<p>The starting point.</p>
<h3>[property:Vector2 v1]</h3>
<p>The first control point.</p>
<h3>[property:Vector2 v2]</h3>
<p>The second control point.</p>
<h3>[property:Vector2 v3]</h3>
<p>The ending point.</p>
<h2>Methods</h2>
<p>See the base [page:Curve] class for common Methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>

View File

@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr;
<h1>[name]</h1>
<p class="desc">
Creates a 2d curve in the shape of an ellipse. Setting the
[page:Number xRadius] equal to the [page:Number yRadius] will result in a circle.
</p>
<h2>Code Example</h2>
<code>
const curve = new THREE.EllipseCurve(
0, 0, // ax, aY
10, 10, // xRadius, yRadius
0, 2 * Math.PI, // aStartAngle, aEndAngle
false, // aClockwise
0 // aRotation
);
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 ellipse = new THREE.Line( geometry, material );
</code>
<h2>Constructor</h2>
<h3>[name]( [param:Float aX], [param:Float aY], [param:Float xRadius], [param:Float yRadius], [param:Radians aStartAngle], [param:Radians aEndAngle], [param:Boolean aClockwise], [param:Radians aRotation] )</h3>
<p>
[page:Float aX] The X center of the ellipse. Default is *0*.<br/>
[page:Float aY] The Y center of the ellipse. Default is *0*.<br/>
[page:Float xRadius] The radius of the ellipse in the x direction. Default is *1*.<br/>
[page:Float yRadius] The radius of the ellipse in the y direction. Default is *1*.<br/>
[page:Radians aStartAngle] The start angle of the curve in radians starting from the positive X axis. Default is *0*.<br/>
[page:Radians aEndAngle] The end angle of the curve in radians starting from the positive X axis. Default is *2 x Math.PI*.<br/>
[page:Boolean aClockwise] Whether the ellipse is drawn clockwise. Default is *false*.<br/>
[page:Radians aRotation] The rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional). Default is *0*.<br/><br/>
</p>
<h2>Properties</h2>
<p>See the base [page:Curve] class for common properties.</p>
<h3>[property:Float aX]</h3>
<p>The X center of the ellipse.</p>
<h3>[property:Float aY]</h3>
<p>The Y center of the ellipse.</p>
<h3>[property:Radians xRadius]</h3>
<p>The radius of the ellipse in the x direction.</p>
<h3>[property:Radians yRadius]</h3>
<p>The radius of the ellipse in the y direction.</p>
<h3>[property:Float aStartAngle]</h3>
<p>The start angle of the curve in radians starting from the middle right side.</p>
<h3>[property:Float aEndAngle]</h3>
<p>The end angle of the curve in radians starting from the middle right side.</p>
<h3>[property:Boolean aClockwise]</h3>
<p>Whether the ellipse is drawn clockwise.</p>
<h3>[property:Float aRotation]</h3>
<p>The rotation angle of the ellipse in radians, counterclockwise from the positive X axis (optional). Default is *0*.</p>
<h2>Methods</h2>
<p>See the base [page:Curve] class for common methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>

View File

@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr;
<h1>[name]</h1>
<p class="desc">A curve representing a 2d line segment.</p>
<h2>Constructor</h2>
<h3>[name]( [param:Vector2 v1], [param:Vector2 v2] )</h3>
<p>
[page:Vector2 v1] The start point.<br/>
[page:Vector2 v2] - The end point.
</p>
<h2>Properties</h2>
<p>See the base [page:Curve] class for common properties.</p>
<h3>[property:Vector2 v1]</h3>
<p>The start point.</p>
<h3>[property:Vector2 v2]</h3>
<p>The end point</p>
<h2>Methods</h2>
<p>See the base [page:Curve] class for common methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>

View File

@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr;
<h1>[name]</h1>
<p class="desc">A curve representing a 3d line segment.</p>
<h2>Constructor</h2>
<h3>[name]( [param:Vector3 v1], [param:Vector3 v2] )</h3>
<p>
[page:Vector3 v1] The start point.<br/>
[page:Vector3 v2] - The end point.
</p>
<h2>Properties</h2>
<p>See the base [page:Curve] class for common properties.</p>
<h3>[property:Vector3 v1]</h3>
<p>The start point.</p>
<h3>[property:Vector3 v2]</h3>
<p>The end point.</p>
<h2>Methods</h2>
<p>See the base [page:Curve] class for common methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>

View File

@@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr;
<h1>[name]</h1>
<p class="desc">
Create a smooth 2d
<a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif" target="_blank">quadratic bezier curve</a>,
defined by a startpoint, endpoint and a single control point.
</p>
<h2>Code Example</h2>
<code>
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 );
</code>
<h2>Constructor</h2>
<h3>[name]( [param:Vector2 v0], [param:Vector2 v1], [param:Vector2 v2] )</h3>
<p>
[page:Vector2 v0] The startpoint.<br/>
[page:Vector2 v1] The control point.<br/>
[page:Vector2 v2] The endpoint.
</p>
<h2>Properties</h2>
<p>See the base [page:Curve] class for common properties.</p>
<h3>[property:Vector2 v0]</h3>
<p>The startpoint.</p>
<h3>[property:Vector2 v1]</h3>
<p>The control point.</p>
<h3>[property:Vector2 v2]</h3>
<p>The endpoint.</p>
<h2>Methods</h2>
<p>See the base [page:Curve] class for common methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>

View File

@@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr;
<h1>[name]</h1>
<p class="desc">
Create a smooth 3d
<a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve#mediaviewer/File:B%C3%A9zier_2_big.gif" target="_blank">quadratic bezier curve</a>,
defined by a startpoint, endpoint and a single control point.
</p>
<h2>Code Example</h2>
<code>
const curve = new THREE.QuadraticBezierCurve3(
new THREE.Vector3( -10, 0, 0 ),
new THREE.Vector3( 20, 15, 0 ),
new THREE.Vector3( 10, 0, 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 );
</code>
<h2>Constructor</h2>
<h3>[name]( [param:Vector3 v0], [param:Vector3 v1], [param:Vector3 v2] )</h3>
<p>
[page:Vector3 v0] The starting point<br/>
[page:Vector3 v1] The middle control point<br/>
[page:Vector3 v2] The ending point<br/>
</p>
<h2>Properties</h2>
<p>See the base [page:Curve] class for common properties.</p>
<h3>[property:Vector3 v0]</h3>
<p>The startpoint.</p>
<h3>[property:Vector3 v1]</h3>
<p>The control point.</p>
<h3>[property:Vector3 v2]</h3>
<p>The endpoint.</p>
<h2>Methods</h2>
<p>See the base [page:Curve] class for common methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>

View File

@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
[page:Curve] &rarr;
<h1>[name]</h1>
<p class="desc">
Create a smooth 2d spline curve from a series of points. Internally this uses
[page:Interpolations.CatmullRom] to create the curve.
</p>
<h2>Code Example</h2>
<code>
// Create a sine-like wave
const curve = new THREE.SplineCurve( [
new THREE.Vector2( -10, 0 ),
new THREE.Vector2( -5, 5 ),
new THREE.Vector2( 0, 0 ),
new THREE.Vector2( 5, -5 ),
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 splineObject = new THREE.Line( geometry, material );
</code>
<h2>Constructor</h2>
<h3>[name]( [param:Array points] )</h3>
<p>points An array of [page:Vector2] points that define the curve.</p>
<h2>Properties</h2>
<p>See the base [page:Curve] class for common properties.</p>
<h3>[property:Array points]</h3>
<p>The array of [page:Vector2] points that define the curve.</p>
<h2>Methods</h2>
<p>See the base [page:Curve] class for common methods.</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>