1
0

DRACOExporter.html 3.0 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 to compress geometry with the Draco library. <br /><br />
  13. [link:https://google.github.io/draco/ Draco] is an open source library for compressing and
  14. decompressing 3D meshes and point clouds. Compressed geometry can be significantly smaller,
  15. at the cost of additional decoding time on the client device.
  16. </p>
  17. <p>
  18. Standalone Draco files have a `.drc` extension, and contain vertex positions,
  19. normals, colors, and other attributes. Draco files *do not* contain materials,
  20. textures, animation, or node hierarchies – to use these features, embed Draco geometry
  21. inside of a glTF file. A normal glTF file can be converted to a Draco-compressed glTF file
  22. using [link:https://github.com/AnalyticalGraphicsInc/gltf-pipeline glTF-Pipeline].
  23. </p>
  24. <h2>Import</h2>
  25. <p>
  26. [name] is an add-on, and must be imported explicitly.
  27. See [link:#manual/introduction/Installation Installation / Addons].
  28. </p>
  29. <code>
  30. import { DRACOExporter } from 'three/addons/exporters/DRACOExporter.js';
  31. </code>
  32. <h2>Code Example</h2>
  33. <code>
  34. // Instantiate a exporter
  35. const exporter = new DRACOExporter();
  36. // Parse the input and generate the DRACO encoded output
  37. const binaryData = exporter.parse( mesh, options );
  38. </code>
  39. <h2>Examples</h2>
  40. <p>
  41. [example:misc_exporter_draco]
  42. </p>
  43. <h2>Constructor</h2>
  44. <h3>[name]()</h3>
  45. <p>
  46. Creates a new [name].
  47. </p>
  48. <h2>Methods</h2>
  49. <h3>[method:Int8Array parse]( [param:Mesh object] | [param:Points object], [param:Object options] )</h3>
  50. <p>
  51. [page:Mesh object] | [page:Points object] — Mesh or Points to encode.<br />
  52. [page:Options options] — Optional export options<br />
  53. <ul>
  54. <li>decodeSpeed - int. Indicates how to tune the encoder regarding decode speed (0 gives better speed but worst quality). Default is 5</li>
  55. <li>encodeSpeed - int. Indicates how to tune the encoder parameters (0 gives better speed but worst quality). Default is 5.</li>
  56. <li>encoderMethod - int. Either sequential (very little compression) or Edgebreaker. Edgebreaker traverses the triangles of the mesh in a deterministic, spiral-like way which provides most of the benefits of this data format. Default is DRACOExporter.MESH_EDGEBREAKER_ENCODING.</li>
  57. <li>quantization - Array of int. Indicates the presision of each type of data stored in the draco file in the order (POSITION, NORMAL, COLOR, TEX_COORD, GENERIC). Default is [ 16, 8, 8, 8, 8 ]</li>
  58. <li>exportUvs - bool. Default is true.</li>
  59. <li>exportNormals - bool. Default is true.</li>
  60. <li>exportColor - bool. Default is false.</li>
  61. </ul>
  62. </p>
  63. <h2>Source</h2>
  64. <p>
  65. [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/DRACOExporter.js examples/jsm/exporters/DRACOExporter.js]
  66. </p>
  67. </body>
  68. </html>