OBJLoader.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <script src="../../list.js"></script>
  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. <div class="desc">A loader for loading an <em>.obj</em> resource.</div>
  12. <h2>Constructor</h2>
  13. <h3>[name]( [page:LoadingManager manager] )</h3>
  14. <div>
  15. [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
  16. </div>
  17. <div>
  18. Creates a new [name].
  19. </div>
  20. <h2>Properties</h2>
  21. <h2>Methods</h2>
  22. <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
  23. <div>
  24. [page:String url] — required<br />
  25. [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Object3D].<br />
  26. [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 />
  27. [page:Function onError] — Will be called when load errors.<br />
  28. </div>
  29. <div>
  30. Begin loading from url and call onLoad with the parsed response content.
  31. </div>
  32. <h3>[method:Object3D parse]( [page:String text] )</h3>
  33. <div>
  34. [page:String text] — The textual <em>obj</em> structure to parse.
  35. </div>
  36. <div>
  37. Parse an <em>obj</em> text structure and return an [page:Object3D].<br />
  38. Found objects are converted to [page:Mesh] with a [page:BufferGeometry] and a default [page:MeshLambertMaterial].
  39. </div>
  40. <h2>Example</h2>
  41. <code>
  42. // instantiate a loader
  43. var loader = new THREE.OBJLoader();
  44. // load a resource
  45. loader.load(
  46. // resource URL
  47. 'models/skinned/UCS_config.json',
  48. // Function when resource is loaded
  49. function ( object ) {
  50. scene.add( object );
  51. }
  52. );
  53. </code>
  54. [example:webgl_loader_obj]
  55. <h2>Source</h2>
  56. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJLoader.js examples/js/loaders/OBJLoader.js]
  57. </body>
  58. </html>