VRMLLoader.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>VRMLLoader - 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">VRMLLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the VRML format.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const loader = new VRMLLoader();
  19. const object = await loader.loadAsync( 'models/vrml/house.wrl' );
  20. scene.add( object );
  21. </code></pre></div>
  22. </header>
  23. <article>
  24. <h2 class="subsection-title">Import</h2>
  25. <p><span translate="no">VRMLLoader</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  26. <pre><code class="language-js">import { VRMLLoader } from 'three/addons/loaders/VRMLLoader.js';</code></pre>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="VRMLLoader" translate="no">new <a href="#VRMLLoader">VRMLLoader</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 VRML 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 passes the loaded VRML asset
  49. to the <code>onLoad()</code> callback.</p>
  50. </div>
  51. <table class="params">
  52. <tbody>
  53. <tr>
  54. <td class="name"><code>url</code></td>
  55. <td class="description last"><p>The path/URL of the file to be loaded. This can also be a data URI.</p></td>
  56. </tr>
  57. <tr>
  58. <td class="name"><code>onLoad</code></td>
  59. <td class="description last"><p>Executed when the loading process has been finished.</p></td>
  60. </tr>
  61. <tr>
  62. <td class="name"><code>onProgress</code></td>
  63. <td class="description last"><p>Executed while the loading is in progress.</p></td>
  64. </tr>
  65. <tr>
  66. <td class="name"><code>onError</code></td>
  67. <td class="description last"><p>Executed when errors occur.</p></td>
  68. </tr>
  69. </tbody>
  70. </table>
  71. <dl class="details">
  72. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  73. </dl>
  74. </div>
  75. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( data : <span class="param-type">string</span>, path : <span class="param-type">string</span> )</span><span class="type-signature"> : <a href="Scene.html">Scene</a></span> </h3>
  76. <div class="method">
  77. <div class="description">
  78. <p>Parses the given VRML data and returns the resulting scene.</p>
  79. </div>
  80. <table class="params">
  81. <tbody>
  82. <tr>
  83. <td class="name"><code>data</code></td>
  84. <td class="description last"><p>The raw VRML data as a string.</p></td>
  85. </tr>
  86. <tr>
  87. <td class="name"><code>path</code></td>
  88. <td class="description last"><p>The URL base path.</p></td>
  89. </tr>
  90. </tbody>
  91. </table>
  92. <dl class="details">
  93. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  94. </dl>
  95. <dl class="details">
  96. <dt class="tag-returns"><strong>Returns:</strong> The parsed scene.</dt>
  97. </dl>
  98. </div>
  99. <h2 class="subsection-title">Source</h2>
  100. <p>
  101. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/VRMLLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/VRMLLoader.js</a>
  102. </p>
  103. </article>
  104. </section>
  105. <script src="../scripts/linenumber.js"></script>
  106. <script src="../scripts/page.js"></script>
  107. </body>
  108. </html>
粤ICP备19079148号