BufferGeometryUtils.html 3.4 KB

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