ColladaLoader.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. <div class="desc">A loader for <em>Collada</em> files.</div>
  13. <h2>Example</h2>
  14. <code>
  15. // instantiate a loader
  16. var loader = new THREE.ColladaLoader();
  17. loader.load(
  18. // resource URL
  19. 'models/collada/monster/monster.dae',
  20. // Function when resource is loaded
  21. function ( collada ) {
  22. scene.add( collada.scene );
  23. },
  24. // Function called when download progresses
  25. function ( xhr ) {
  26. console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
  27. }
  28. );
  29. </code>
  30. [example:webgl_loader_collada]<br />
  31. [example:webgl_loader_collada_keyframe]<br />
  32. [example:webgl_loader_collada_skinning]<br />
  33. [example:webgl_loader_collada_kinematics]
  34. <h2>Constructor</h2>
  35. <h3>[name]()</h3>
  36. <div>
  37. Creates a new [name].
  38. </div>
  39. <h2>Properties</h2>
  40. <h3>[property:Array options]</h3>
  41. <div>
  42. &nbsp;.[page:Boolean centerGeometry] — Force [page:Geometry] to always be centered at the local origin of the containing [page: Mesh].<br />
  43. &nbsp;.[page:Boolean convertUpAxis] — Axis conversion is done for geometries, animations, and controllers.<br />
  44. &nbsp;.[page:Boolean subdivideFaces] — Force subdivision into multiple [page: Face3].<br />
  45. &nbsp;.[page:String upAxis] — X, Y or Z<br />
  46. &nbsp;.[page:Boolean defaultEnvMap] — Cubemap to use for reflective or refractive materials.<br />
  47. </div>
  48. <h3>[property:Object geometries]</h3>
  49. <div>
  50. Parsed <em>.dae</em> geometries.
  51. </div>
  52. <h2>Methods</h2>
  53. <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress] )</h3>
  54. <div>
  55. [page:String url] — required<br />
  56. [page:function onLoad] — Will be called when load completes. The argument will be an [page:Object object] containing loaded resources.<br />
  57. [page:function onProgress] — Will be called while load progresses. The argument will be an object containing .[page:Integer total] and .[page:Integer loaded] bytes.<br />
  58. </div>
  59. <div>
  60. Begin loading from url and call onLoad with the parsed response content.
  61. </div>
  62. <h3>[method:Object parse]( [page:Document doc], [page:Function callBack], [page:String url] )</h3>
  63. <div>
  64. [page:Document doc] — The <em>XML</em> document to parse.<br />
  65. [page:Function callBack] — Will be called when parse completes.<br />
  66. [page:String url] — The base url from which to find subsequent resources.<br />
  67. </div>
  68. <div>
  69. Parse an <em>XML Document</em> and return an [page:Object object] that contain loaded parts: .[page:Scene scene], .[page:Array morphs], .[page:Array skins], .[page:Array animations], .[page:Object dae]
  70. </div>
  71. <h3>[method:null applySkin]( [page:Geometry geometry], [page:Object instanceCtrl], [page:Integer frame] )</h3>
  72. <div>
  73. [page:Geometry geometry] — required<br />
  74. [page:Object instanceCtrl] — required. A collada <em>skinController</em><br />
  75. [page:Integer frame] — optionnal. Default is 40<br />
  76. </div>
  77. <div>
  78. Apply a skin (vertices, animation, bones) from a <em>collada skin controller</em>, on the given [page:Geometry].
  79. </div>
  80. <h2>Source</h2>
  81. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/ColladaLoader.js examples/js/loaders/ColladaLoader.js]
  82. </body>
  83. </html>