ColladaExporter.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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/" target="_blank">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:Object 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. <li>upAxis - string. Either Y_UP (default), Z_UP or X_UP.</li>
  44. <li>unitName - string. Name of the unit. Can be any string, but could be for example "meter", "inch", or "parsec".</li>
  45. <li>unitMeter - number. Length of the unit in meters.</li>
  46. </ul>
  47. </p>
  48. <p>
  49. Generates an object with Collada file and texture data. This object is returned from the function and passed into the "onCompleted" callback.
  50. <code>
  51. {
  52. // Collada file content
  53. data: "",
  54. // List of referenced textures
  55. textures: [{
  56. // File directory, name, and extension of the texture data
  57. directory: "",
  58. name: "",
  59. ext: "",
  60. // The texture data and original texture object
  61. data: [],
  62. original: &ltTHREE.Texture&gt
  63. }, ...]
  64. }
  65. </code>
  66. </p>
  67. <h2>Source</h2>
  68. <p>
  69. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/ColladaExporter.js examples/jsm/exporters/ColladaExporter.js]
  70. </p>
  71. </body>
  72. </html>