BufferAttributeUsage.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. <h1>Costanti di utilizzo degli attributi del buffer</h1>
  11. <p>
  12. Le costanti di utilizzo possono essere utilizzate per fornire un suggerimento all'API su come verrà utilizzato l'attributo
  13. del buffer della geometria per ottimizzare le prestazioni.
  14. </p>
  15. <h2>Codice di Esempio</h2>
  16. <code>
  17. const geometry = new THREE.BufferGeometry();
  18. const positionAttribute = new THREE.BufferAttribute( array, 3 , false );
  19. positionAttribute.setUsage( THREE.DynamicDrawUsage );
  20. geometry.setAttribute( 'position', positionAttribute );
  21. </code>
  22. <h2>Esempi</h2>
  23. <p>[example:webgl_buffergeometry_drawrange materials / buffergeometry / drawrange ]</p>
  24. <h2>Utilizzo della Geometria</h2>
  25. <code>
  26. THREE.StaticDrawUsage
  27. THREE.DynamicDrawUsage
  28. THREE.StreamDrawUsage
  29. THREE.StaticReadUsage
  30. THREE.DynamicReadUsage
  31. THREE.StreamReadUsage
  32. THREE.StaticCopyUsage
  33. THREE.DynamicCopyUsage
  34. THREE.StreamCopyUsage
  35. </code>
  36. Per informazioni più dettagliate su ciascuna di queste costanti consultare
  37. [link:https://www.khronos.org/opengl/wiki/Buffer_Object#Buffer_Object_Usage questa documentazione di OpenGL].
  38. <h2>Source</h2>
  39. <p>
  40. [link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
  41. </p>
  42. </body>
  43. </html>