BufferGeometryUtils.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!DOCTYPE html>
  2. <html lang="en">
  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>[name]</h1>
  11. <p class="desc">
  12. A class containing utility functions for [page:BufferGeometry BufferGeometry] instances.
  13. </p>
  14. <h2>Methods</h2>
  15. <h3>[method:null computeTangents]( [param:BufferGeometry geometry] )</h3>
  16. <p>
  17. geometry -- A [page:BufferGeometry BufferGeometry] instance, which must have index, position, normal, and uv attributes.<br /><br />
  18. Calculates and adds tangent attribute to a geometry.
  19. </p>
  20. <h3>[method:BufferGeometry mergeBufferGeometries]( [param:Array geometries], [param:Boolean useGroups] )</h3>
  21. <p>
  22. geometries -- Array of [page:BufferGeometry BufferGeometry] instances.<br />
  23. useGroups -- Whether groups should be generated for the merged geometry or not.<br /><br />
  24. Merges a set of geometries into a single instance. All geometries must have compatible attributes.
  25. If merge does not succeed, the method returns null.
  26. </p>
  27. <h3>[method:BufferAttribute mergeBufferAttributes]( [param:Array attributes] )</h3>
  28. <p>
  29. attributes -- Array of [page:BufferAttribute BufferAttribute] instances.<br /><br />
  30. Merges a set of attributes into a single instance. All attributes must have compatible properties
  31. and types, and [page:InterleavedBufferAttribute InterleavedBufferAttributes] are not supported. If merge does not succeed, the method
  32. returns null.
  33. </p>
  34. <h3>[method:InterleavedBufferAttribute interleaveAttributes]( [param:Array attributes] )</h3>
  35. <p>
  36. attributes -- Array of [page:BufferAttribute BufferAttribute] instances.<br /><br />
  37. Interleaves a set of attributes and returns a new array of corresponding attributes that share
  38. a single InterleavedBuffer instance. All attributes must have compatible types. If merge does not
  39. succeed, the method returns null.
  40. </p>
  41. <h3>[method:Number estimateBytesUsed]( [param:BufferGeometry geometry] )</h3>
  42. <p>
  43. geometry -- Instance of [page:BufferGeometry BufferGeometry] to estimate the memory use of.<br /><br />
  44. Returns the amount of bytes used by all attributes to represent the geometry.
  45. </p>
  46. <h3>[method:BufferGeometry mergeVertices]( [param:BufferGeometry geometry], [param:Number tolerance] )</h3>
  47. <p>
  48. geometry -- Instance of [page:BufferGeometry BufferGeometry] to merge the vertices of.<br />
  49. tolerance -- The maximum allowable difference between vertex attributes to merge. Defaults to 1e-4.<br /><br />
  50. Returns a new [page:BufferGeometry BufferGeometry] with vertices for which all similar vertex attributes
  51. (within tolerance) are merged.
  52. </p>
  53. <h3>[method:BufferGeometry toTrianglesDrawMode]( [param:BufferGeometry geometry], [param:TrianglesDrawMode drawMode] )</h3>
  54. <p>
  55. geometry -- Instance of [page:BufferGeometry BufferGeometry].<br />
  56. drawMode -- The draw mode of the given geometry.<br /><br />
  57. Returns a new indexed [page:BufferGeometry BufferGeometry] based on the [page:DrawModes THREE.TrianglesDrawMode] draw mode. This mode
  58. corresponds to the *gl.TRIANGLES* WebGL primitive.
  59. </p>
  60. <h2>Source</h2>
  61. <p>
  62. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/BufferGeometryUtils.js examples/jsm/utils/BufferGeometryUtils.js]
  63. </p>
  64. </body>
  65. </html>