2
0

BoxGeometry.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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">
  13. [name] è una classe di geometria per un cuboide rettangolare con una determinata 'larghezza' (width), 'altezza' (height) e 'profondità' (depth).
  14. Al momento della creazione, il cuboide è centrato nell'origine, con ciascun bordo parallelo ad uno degli assi.
  15. </p>
  16. <iframe id="scene" src="scenes/geometry-browser.html#BoxGeometry"></iframe>
  17. <script>
  18. // iOS iframe auto-resize workaround
  19. if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
  20. const scene = document.getElementById( 'scene' );
  21. scene.style.width = getComputedStyle( scene ).width;
  22. scene.style.height = getComputedStyle( scene ).height;
  23. scene.setAttribute( 'scrolling', 'no' );
  24. }
  25. </script>
  26. <h2>Codice di Esempio</h2>
  27. <code>const geometry = new THREE.BoxGeometry( 1, 1, 1 );
  28. const material = new THREE.MeshBasicMaterial( {color: 0x00ff00} );
  29. const cube = new THREE.Mesh( geometry, material );
  30. scene.add( cube );
  31. </code>
  32. <h2>Costruttore</h2>
  33. <h3>[name]([param:Float width], [param:Float height], [param:Float depth], [param:Integer widthSegments], [param:Integer heightSegments], [param:Integer depthSegments])</h3>
  34. <p>
  35. width — Larghezza; cioè la lunghezza dei bordi paralleli all'asse X. Opzionale; il valore predefinito è 1.<br />
  36. height — Altezza; cioè la lunghezza dei bordi paralleli all'asse Y. Opzionale; il valore predefinito è 1.<br />
  37. depth — Profondità; cioè la lunghezza dei bordi paralleli all'asse Z. Opzionale; il valore predefinito è 1.<br />
  38. widthSegments — Numero di facce rettangolari segmentate lungo la larghezza dei lati. Opzionale; il valore predefinito è 1.<br />
  39. heightSegments — Numero di facce rettangolari segmentate lungo l'altezza dei lati. Opzionale; il valore predefinito è 1.<br />
  40. depthSegments — Numero di facce rettangolari segmentate lungo la profondità dei lati. Opzionale; il valore predefinito è 1.<br />
  41. </p>
  42. <h2>Proprietà</h2>
  43. <p>Vedi la classe base [page:BufferGeometry] per le proprietà comuni.</p>
  44. <h3>[property:Object parameters]</h3>
  45. <p>
  46. Un oggetto con una proprietà per ognuno dei parametri del costruttore. Qualsiasi modifica dopo l'istanziazione non cambia la geometria.
  47. </p>
  48. <h2>Metodi</h2>
  49. <p>Vedi la classe base [page:BufferGeometry] per i metodi comuni.</p>
  50. <h2>Source</h2>
  51. <p>
  52. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  53. </p>
  54. </body>
  55. </html>