MTLLoader.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 loading an <em>.mtl</em> resource, used internaly by [page:OBJMTLLoader] and [page:UTF8Loader].</div>
  13. <h2>Constructor</h2>
  14. <h3>[name]( [page:LoadingManager loadingManager] )</h3>
  15. <div>
  16. [page:LoadingManager loadingManager] — LoadingManager to use. Defaults to [page:DefaultLoadingManager DefaultLoadingManager]<br />
  17. </div>
  18. <div>
  19. Creates a new [name].
  20. </div>
  21. <!-- <h2>Properties</h2> -->
  22. <h2>Methods</h2>
  23. <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
  24. <div>
  25. [page:String url] — required<br />
  26. [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.<br />
  27. [page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
  28. [page:Function onError] — Will be called when load errors.<br />
  29. </div>
  30. <div>
  31. Begin loading from url and return the loaded material.
  32. </div>
  33. <h3>[method:null setPath]( [page:String path] )</h3>
  34. <div>
  35. [page:String path] — required<br />
  36. </div>
  37. <div>
  38. Set base path for resolving references. If set this path will be prepended to each loaded and found reference.
  39. </div>
  40. <h3>[method:null setTexturePath]( [page:String path] )</h3>
  41. <div>
  42. [page:String path] — required<br />
  43. </div>
  44. <div>
  45. Set base path for resolving texture references. If set this path will be prepended found texture reference. If not set and setPath is, it will be used as texture base path.
  46. </div>
  47. <h3>[method:null setCrossOrigin]( [page:boolean useCrossOrigin] )</h3>
  48. <div>
  49. [page:boolean useCrossOrigin] — required<br />
  50. </div>
  51. <div>
  52. Set to true if you need to load textures from a different origin.
  53. </div>
  54. <h3>[method:null setMaterialOptions]( [page:Object options] )</h3>
  55. <div>
  56. [page:Object options] — required
  57. <ul>
  58. <li>side: Which side to apply the material. THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide</li>
  59. <li>wrap: What type of wrapping to apply for textures. THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping</li>
  60. <li>normalizeRGB: RGBs need to be normalized to 0-1 from 0-255. Default: false, assumed to be already normalized</li>
  61. <li>ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's. Default: false</li>
  62. </ul>
  63. </div>
  64. <div>
  65. Set of options on how to construct the materials
  66. </div>
  67. <h3>[method:MTLLoaderMaterialCreator parse]( [page:String text] )</h3>
  68. <div>
  69. [page:String text] — The textual <em>mtl</em> structure to parse.
  70. </div>
  71. <div>
  72. Parse a <em>mtl</em> text structure and return a [page:MTLLoaderMaterialCreator] instance.<br />
  73. </div>
  74. <h2>Source</h2>
  75. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/[name].js examples/js/loaders/[name].js]
  76. </body>
  77. </html>