BufferGeometryUtils.html 3.0 KB

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