ColladaExporter.html 2.3 KB

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