InstancedMesh.html 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. [page:Mesh] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">
  14. A special version of [page:Mesh] with instanced rendering support. Use [name] if you have to render a large amount of
  15. objects with the same geometry and material but with different world transformations. The usage of [name] will help you
  16. to reduce the amount of draw calls and thus improve the overall rendering performance in your application.
  17. </p>
  18. <h3>Example</h3>
  19. <p>
  20. [example:webgl_instancing_suzanne WebGL / instancing / suzanne]<br />
  21. </p>
  22. <h2>Constructor</h2>
  23. <h3>[name]( [param:BufferGeometry geometry], [param:Material material], [param:Integer count] )</h3>
  24. <p>
  25. [page:Geometry geometry] - an instance of [page:BufferGeometry].<br />
  26. [page:Material material] - an instance of [page:Material]. Default is a new [page:MeshBasicMaterial].<br />
  27. [page:Integer count] - the amount of instances.<br />
  28. </p>
  29. <h2>Properties</h2>
  30. <p>See the base [page:Mesh] class for common properties.</p>
  31. <h3>[property:Integer count]</h3>
  32. <p>
  33. The amount of instances. The *count* value passed into the constructor represents the maximum amount of
  34. instances of this mesh. You can change the amount of instances at runtime to an integer value
  35. in the range [0, count].
  36. </p>
  37. <p>
  38. If you need more instances than the original count value, you have to create a new [name].
  39. </p>
  40. <h3>[property:Boolean isInstancedMesh]</h3>
  41. <p>
  42. Used to check whether this or derived classes are instanced meshes.
  43. You should not change this, as it used internally for optimization. Default is *true*.
  44. </p>
  45. <h3>[property:BufferAttribute instanceMatrix]</h3>
  46. <p>
  47. Represents the local transformation of all instances. For internal use only.
  48. </p>
  49. <h2>Methods</h2>
  50. <p>See the base [page:Mesh] class for common methods.</p>
  51. <h3>[method:null setMatrixAt]( [param:Integer index], [param:Matrix4 matrix] )</h3>
  52. <p>
  53. [page:Integer index]: The index of an instance. Values have to be in the range [0, count].
  54. </p>
  55. <p>
  56. [page:Matrix4 matrix]: A 4x4 matrix representing the local transformation of a single instance.
  57. </p>
  58. <p>
  59. Sets the given local transformation matrix to the defined instance.
  60. </p>
  61. <h2>Source</h2>
  62. <p>
  63. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  64. </p>
  65. </body>
  66. </html>