OBJExporter.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>OBJExporter - 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. <h1 translate="no">OBJExporter</h1>
  13. <section>
  14. <header>
  15. <div class="class-description"><p>An exporter for OBJ.</p>
  16. <p><code>OBJExporter</code> is not able to export material data into MTL files so only geometry data are supported.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const exporter = new OBJExporter();
  19. const data = exporter.parse( scene );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">OBJExporter</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  25. <pre><code class="language-js">import { OBJExporter } from 'three/addons/exporters/OBJExporter.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="OBJExporter" translate="no">new <a href="#OBJExporter">OBJExporter</a><span class="signature">()</span> </h3>
  29. <div class="method">
  30. </div>
  31. </div>
  32. <h2 class="subsection-title">Methods</h2>
  33. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( object : <span class="param-type">Object3D</span> )</span><span class="type-signature"> : string</span> </h3>
  34. <div class="method">
  35. <div class="description">
  36. <p>Parses the given 3D object and generates the OBJ output.</p>
  37. <p>If the 3D object is composed of multiple children and geometry, they are merged into a single mesh in the file.</p>
  38. </div>
  39. <table class="params">
  40. <tbody>
  41. <tr>
  42. <td class="name"><code>object</code></td>
  43. <td class="description last"><p>The 3D object to export.</p></td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. <dl class="details">
  48. <dt class="tag-returns"><strong>Returns:</strong> The exported OBJ.</dt>
  49. </dl>
  50. </div>
  51. <h2 class="subsection-title">Source</h2>
  52. <p>
  53. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/OBJExporter.js" target="_blank" rel="noopener" translate="no">examples/jsm/exporters/OBJExporter.js</a>
  54. </p>
  55. </article>
  56. </section>
  57. <script src="../scripts/linenumber.js"></script>
  58. <script src="../scripts/page.js"></script>
  59. </body>
  60. </html>
粤ICP备19079148号