SplineCurve.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:Curve] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. Crea una curva spline 2D smooth da una serie di punti. Internamente
  14. utilizza [page:Interpolations.CatmullRom] per creare la curva.
  15. </p>
  16. <h2>Codice di Esempio</h2>
  17. <code>
  18. // Crea un onda sinusoidale
  19. const curve = new THREE.SplineCurve( [
  20. new THREE.Vector2( -10, 0 ),
  21. new THREE.Vector2( -5, 5 ),
  22. new THREE.Vector2( 0, 0 ),
  23. new THREE.Vector2( 5, -5 ),
  24. new THREE.Vector2( 10, 0 )
  25. ] );
  26. const points = curve.getPoints( 50 );
  27. const geometry = new THREE.BufferGeometry().setFromPoints( points );
  28. const material = new THREE.LineBasicMaterial( { color: 0xff0000 } );
  29. // Crea l'oggetto finale da aggiungere alla scena
  30. const splineObject = new THREE.Line( geometry, material );
  31. </code>
  32. <h2>Costruttore</h2>
  33. <h3>[name]( [param:Array points] )</h3>
  34. <p>points – Un array di punti [page:Vector2] che definisce la curva.</p>
  35. <h2>Proprietà</h2>
  36. <p>Vedi la classe [page:Curve] per le proprità comuni.</p>
  37. <h3>[property:Array points]</h3>
  38. <p>L'array di punti [page:Vector2] che definisce la curva.</p>
  39. <h2>Metodi</h2>
  40. <p>Vedi la classe [page:Curve] per i metodi comuni.</p>
  41. <h2>Source</h2>
  42. <p>
  43. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  44. </p>
  45. </body>
  46. </html>