You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.5 KiB
62 lines
1.5 KiB
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<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] →
|
|
|
|
<h1>[name]</h1>
|
|
|
|
<p class="desc">
|
|
Crea una curva spline 2D smooth da una serie di punti. Internamente
|
|
utilizza [page:Interpolations.CatmullRom] per creare la curva.
|
|
</p>
|
|
|
|
<h2>Codice di Esempio</h2>
|
|
|
|
<code>
|
|
// Crea un onda sinusoidale
|
|
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 } );
|
|
|
|
// Crea l'oggetto finale da aggiungere alla scena
|
|
const splineObject = new THREE.Line( geometry, material );
|
|
</code>
|
|
|
|
<h2>Costruttore</h2>
|
|
|
|
|
|
<h3>[name]( [param:Array points] )</h3>
|
|
<p>points – Un array di punti [page:Vector2] che definisce la curva.</p>
|
|
|
|
|
|
<h2>Proprietà</h2>
|
|
<p>Vedi la classe [page:Curve] per le proprità comuni.</p>
|
|
|
|
<h3>[property:Array points]</h3>
|
|
<p>L'array di punti [page:Vector2] che definisce la curva.</p>
|
|
|
|
<h2>Metodi</h2>
|
|
<p>Vedi la classe [page:Curve] per i metodi comuni.</p>
|
|
|
|
<h2>Source</h2>
|
|
|
|
<p>
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
</p>
|
|
</body>
|
|
</html>
|
|
|