ColladaExporter.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. [link:https://www.khronos.org/collada/ Collada] 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>Import</h2>
  19. <p>
  20. [name] is an add-on, and must be imported explicitly.
  21. See [link:#manual/introduction/Installation Installation / Addons].
  22. </p>
  23. <code>
  24. import { ColladaExporter } from 'three/addons/exporters/ColladaExporter.js';
  25. </code>
  26. <h2>Code Example</h2>
  27. <code>
  28. // Instantiate an exporter
  29. const exporter = new ColladaExporter();
  30. // Parse the input and generate the collada ( .dae ) output
  31. const data = exporter.parse( scene, null, options );
  32. downloadFile( data );
  33. </code>
  34. <h2>Constructor</h2>
  35. <h3>[name]()</h3>
  36. <p>
  37. </p>
  38. <p>
  39. Creates a new [name].
  40. </p>
  41. <h2>Methods</h2>
  42. <h3>[method:Object parse]( [param:Object3D input], [param:Function onCompleted], [param:Object options] )</h3>
  43. <p>
  44. [page:Object input] — Object3D to be exported<br />
  45. [page:Function onCompleted] — Will be called when the export completes. Optional. The same data is immediately returned from the function.<br />
  46. [page:Options options] — Export options<br />
  47. <ul>
  48. <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>
  49. <li>author - string. The name to include in the author field. Author field is excluded by default.</li>
  50. <li>textureDirectory - string. The directory relative to the Collada file to save the textures to.</li>
  51. <li>upAxis - string. Either Y_UP (default), Z_UP or X_UP.</li>
  52. <li>unitName - string. Name of the unit. Can be any string, but could be for example "meter", "inch", or "parsec".</li>
  53. <li>unitMeter - number. Length of the unit in meters.</li>
  54. </ul>
  55. </p>
  56. <p>
  57. Generates an object with Collada file and texture data. This object is returned from the function and passed into the "onCompleted" callback.
  58. <code>
  59. {
  60. // Collada file content
  61. data: "",
  62. // List of referenced textures
  63. textures: [{
  64. // File directory, name, and extension of the texture data
  65. directory: "",
  66. name: "",
  67. ext: "",
  68. // The texture data and original texture object
  69. data: [],
  70. original: &ltTHREE.Texture&gt
  71. }, ...]
  72. }
  73. </code>
  74. </p>
  75. <h2>Source</h2>
  76. <p>
  77. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/ColladaExporter.js examples/jsm/exporters/ColladaExporter.js]
  78. </p>
  79. </body>
  80. </html>