BufferGeometryLoader.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>BufferGeometryLoader - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="Loader.html">Loader</a> → </p>
  13. <h1 translate="no">BufferGeometryLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Class for loading geometries. The files are internally
  17. loaded via <a href="FileLoader.html">FileLoader</a>.</p></div>
  18. <h2>Code Example</h2>
  19. <div translate="no"><pre><code class="language-js">const loader = new THREE.BufferGeometryLoader();
  20. const geometry = await loader.loadAsync( 'models/json/pressure.json' );
  21. const material = new THREE.MeshBasicMaterial( { color: 0xF5F5F5 } );
  22. const object = new THREE.Mesh( geometry, material );
  23. scene.add( object );
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="BufferGeometryLoader" translate="no">new <a href="#BufferGeometryLoader">BufferGeometryLoader</a><span class="signature">( manager : <span class="param-type">LoadingManager</span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new geometry loader.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name"><code>manager</code></td>
  38. <td class="description last"><p>The loading manager.</p></td>
  39. </tr>
  40. </tbody>
  41. </table>
  42. </div>
  43. </div>
  44. <h2 class="subsection-title">Methods</h2>
  45. <h3 class="name name-method" id="load" translate="no">.<a href="#load">load</a><span class="signature">( url : <span class="param-type">string</span>, onLoad : <span class="param-type">function</span>, onProgress : <span class="param-type">onProgressCallback</span>, onError : <span class="param-type">onErrorCallback</span> )</span> </h3>
  46. <div class="method">
  47. <div class="description">
  48. <p>Starts loading from the given URL and pass the loaded geometry to the <code>onLoad()</code> callback.</p>
  49. </div>
  50. <table class="params">
  51. <tbody>
  52. <tr>
  53. <td class="name"><code>url</code></td>
  54. <td class="description last"><p>The path/URL of the file to be loaded. This can also be a data URI.</p></td>
  55. </tr>
  56. <tr>
  57. <td class="name"><code>onLoad</code></td>
  58. <td class="description last"><p>Executed when the loading process has been finished.</p></td>
  59. </tr>
  60. <tr>
  61. <td class="name"><code>onProgress</code></td>
  62. <td class="description last"><p>Executed while the loading is in progress.</p></td>
  63. </tr>
  64. <tr>
  65. <td class="name"><code>onError</code></td>
  66. <td class="description last"><p>Executed when errors occur.</p></td>
  67. </tr>
  68. </tbody>
  69. </table>
  70. <dl class="details">
  71. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  72. </dl>
  73. </div>
  74. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( json : <span class="param-type">Object</span> )</span><span class="type-signature"> : <a href="BufferGeometry.html">BufferGeometry</a></span> </h3>
  75. <div class="method">
  76. <div class="description">
  77. <p>Parses the given JSON object and returns a geometry.</p>
  78. </div>
  79. <table class="params">
  80. <tbody>
  81. <tr>
  82. <td class="name"><code>json</code></td>
  83. <td class="description last"><p>The serialized geometry.</p></td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. <dl class="details">
  88. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  89. </dl>
  90. <dl class="details">
  91. <dt class="tag-returns"><strong>Returns:</strong> The parsed geometry.</dt>
  92. </dl>
  93. </div>
  94. <h2 class="subsection-title">Source</h2>
  95. <p>
  96. <a href="https://github.com/mrdoob/three.js/blob/master/src/loaders/BufferGeometryLoader.js" target="_blank" rel="noopener" translate="no">src/loaders/BufferGeometryLoader.js</a>
  97. </p>
  98. </article>
  99. </section>
  100. <script src="../scripts/linenumber.js"></script>
  101. <script src="../scripts/page.js"></script>
  102. </body>
  103. </html>
粤ICP备19079148号