LatheGeometry.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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:BufferGeometry] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">Crea mesh con simmetria assiale come vasi. Il tornio ruota attorno all'asse Y.</p>
  13. <iframe id="scene" src="scenes/geometry-browser.html#LatheGeometry"></iframe>
  14. <script>
  15. // iOS iframe auto-resize workaround
  16. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  17. const scene = document.getElementById( 'scene' );
  18. scene.style.width = getComputedStyle( scene ).width;
  19. scene.style.height = getComputedStyle( scene ).height;
  20. scene.setAttribute( 'scrolling', 'no' );
  21. }
  22. </script>
  23. <h2>Codice di Esempio</h2>
  24. <code>
  25. const points = [];
  26. for ( let i = 0; i < 10; i ++ ) {
  27. points.push( new THREE.Vector2( Math.sin( i * 0.2 ) * 10 + 5, ( i - 5 ) * 2 ) );
  28. }
  29. const geometry = new THREE.LatheGeometry( points );
  30. const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
  31. const lathe = new THREE.Mesh( geometry, material );
  32. scene.add( lathe );
  33. </code>
  34. <h2>Costruttore</h2>
  35. <h3>[name]([param:Array points], [param:Integer segments], [param:Float phiStart], [param:Float phiLength])</h3>
  36. <p>
  37. points — Array di Vector2. La coordinata x di ogni punto deve essere maggiore di zero.
  38. Il valore predefinito è un array con (0,-0.5), (0.5,0) e (0,0.5) il quale crea una semplice forma a diamante.<br />
  39. segments — il numero di segmenti di circonferenza da generare. Il valore predefinito è 12.<br />
  40. phiStart — l'angolo di partenza in radianti. Il valore predefinito è 0.<br />
  41. phiLength — l'intervallo in radianti (da 0 ta 2PI) della sezione tornita 2PI è un tornio chiuso, meno di 2PI è una porzione. Il valore predefinito è 2PI.
  42. </p>
  43. <p>
  44. Questo crea una [name] basata sui parametri.
  45. </p>
  46. <h2>Proprietà</h2>
  47. <p>Vedi la classe base [page:BufferGeometry] per le proprietà comuni.</p>
  48. <h3>[property:Object parameters]</h3>
  49. <p>
  50. Un oggetto con una proprietà per ognuno dei parametri del costruttore. Qualsiasi modifica dopo l'istanziazione non cambia la geometria.
  51. </p>
  52. <h2>Metodi</h2>
  53. <p>Vedi la classe base [page:BufferGeometry] per i metodi comuni.</p>
  54. <h2>Source</h2>
  55. <p>
  56. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  57. </p>
  58. </body>
  59. </html>