OBJLoader.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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>.obj</em> resource.</div>
  13. <h2>Constructor</h2>
  14. <h3>[name]( [page:LoadingManager manager] )</h3>
  15. <div>
  16. [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
  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:Object3D].<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 call onLoad with the parsed response content.
  32. </div>
  33. <h3>[method:Object3D parse]( [page:String text] )</h3>
  34. <div>
  35. [page:String text] — The textual <em>obj</em> structure to parse.
  36. </div>
  37. <div>
  38. Parse an <em>obj</em> text structure and return an [page:Object3D].<br />
  39. Found objects are converted to [page:Mesh] with a [page:BufferGeometry] and a default [page:MeshLambertMaterial].
  40. </div>
  41. <h2>Example</h2>
  42. <code>
  43. // instantiate a loader
  44. var loader = new THREE.OBJLoader();
  45. // load a resource
  46. loader.load(
  47. // resource URL
  48. 'models/skinned/UCS_config.json',
  49. // Function when resource is loaded
  50. function ( object ) {
  51. scene.add( object );
  52. }
  53. );
  54. </code>
  55. [example:webgl_loader_obj]
  56. <h2>Source</h2>
  57. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJLoader.js examples/js/loaders/OBJLoader.js]
  58. </body>
  59. </html>