MTLLoader.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. [page:Loader] &rarr;
  12. <h1>[name]</h1>
  13. <p class="desc">A loader for loading an <em>.mtl</em> resource, used internaly by [page:OBJLoader].<br />
  14. The Material Template Library format (MTL) or .MTL File Format is a companion file format to .OBJ that describes surface shading
  15. (material) properties of objects within one or more .OBJ files.
  16. </p>
  17. <h2>Constructor</h2>
  18. <h3>[name]( [param:LoadingManager loadingManager] )</h3>
  19. <p>
  20. [page:LoadingManager loadingManager] — LoadingManager to use. Defaults to [page:DefaultLoadingManager DefaultLoadingManager]<br />
  21. </p>
  22. <p>
  23. Creates a new [name].
  24. </p>
  25. <h2>Properties</h2>
  26. <p>See the base [page:Loader] class for common properties.</p>
  27. <h2>Methods</h2>
  28. <p>See the base [page:Loader] class for common methods.</p>
  29. <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
  30. <p>
  31. [page:String url] — A string containing the path/URL of the <em>.mtl</em> file.<br />
  32. [page:Function onLoad] — (optional) A function to be called after the loading is successfully completed. The function receives the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.<br />
  33. [page:Function onProgress] — (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, which contains [page:Integer total] and [page:Integer loaded] bytes.<br />
  34. [page:Function onError] — (optional) A function to be called if an error occurs during loading. The function receives the error as an argument.<br />
  35. </p>
  36. <p>
  37. Begin loading from url and return the loaded material.
  38. </p>
  39. <h3>[method:MTLLoader setMaterialOptions]( [param:Object options] )</h3>
  40. <p>
  41. [page:Object options] — required
  42. <ul>
  43. <li>side: Which side to apply the material. THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide</li>
  44. <li>wrap: What type of wrapping to apply for textures. THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping</li>
  45. <li>normalizeRGB: RGBs need to be normalized to 0-1 from 0-255. Default: false, assumed to be already normalized</li>
  46. <li>ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's. Default: false</li>
  47. <li>invertTrProperty: Use values 1 of Tr field for fully opaque. This option is useful for obj exported from 3ds MAX, vcglib or meshlab. Default: false</li>
  48. </ul>
  49. </p>
  50. <p>
  51. Set of options on how to construct the materials
  52. </p>
  53. <h3>[method:MTLLoaderMaterialCreator parse]( [param:String text, param:String path] )</h3>
  54. <p>
  55. [page:String text] — The textual <em>mtl</em> structure to parse.
  56. [page:String path] — The path to the MTL file.
  57. </p>
  58. <p>
  59. Parse a <em>mtl</em> text structure and return a [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.<br />
  60. </p>
  61. <h2>Source</h2>
  62. <p>
  63. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/[name].js examples/js/loaders/[name].js]
  64. </p>
  65. </body>
  66. </html>