ColladaExporter.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>[name]</h1>
  11. <p class="desc">
  12. An exporter for *Collada*.
  13. <br /><br />
  14. <a href="https://www.khronos.org/collada/">Collada</a> is a
  15. file format for robust representation of scenes, materials, animations, and other 3D content in an xml format.
  16. This exporter only supports exporting geometry, materials, textures, and scene hierarchy.
  17. </p>
  18. <h2>Code Example</h2>
  19. <code>
  20. // Instantiate an exporter
  21. const exporter = new ColladaExporter();
  22. // Parse the input and generate the ply output
  23. const data = exporter.parse( scene, null, options );
  24. downloadFile( data );
  25. </code>
  26. <h2>Constructor</h2>
  27. <h3>[name]()</h3>
  28. <p>
  29. </p>
  30. <p>
  31. Creates a new [name].
  32. </p>
  33. <h2>Methods</h2>
  34. <h3>[method:null parse]( [param:Object3D input], [param:Function onCompleted], [param:Object options] )</h3>
  35. <p>
  36. [page:Object input] — Object3D to be exported<br />
  37. [page:Function onCompleted] — Will be called when the export completes. Optional. The same data is immediately returned from the function.<br />
  38. [page:Options options] — Export options<br />
  39. <ul>
  40. <li>version - string. Which version of Collada to export. The options are "1.4.1" or "1.5.0". Defaults to "1.4.1".</li>
  41. <li>author - string. The name to include in the author field. Author field is excluded by default.</li>
  42. <li>textureDirectory - string. The directory relative to the Collada file to save the textures to.</li>
  43. </ul>
  44. </p>
  45. <p>
  46. Generates an object with Collada file and texture data. This object is returned from the function and passed into the "onCompleted" callback.
  47. <code>
  48. {
  49. // Collada file content
  50. data: "",
  51. // List of referenced textures
  52. textures: [{
  53. // File directory, name, and extension of the texture data
  54. directory: "",
  55. name: "",
  56. ext: "",
  57. // The texture data and original texture object
  58. data: [],
  59. original: &ltTHREE.Texture&gt
  60. }, ...]
  61. }
  62. </code>
  63. </p>
  64. <h2>Source</h2>
  65. <p>
  66. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/ColladaExporter.js examples/jsm/exporters/ColladaExporter.js]
  67. </p>
  68. </body>
  69. </html>