BufferGeometryLoader.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 a [page:BufferGeometry].</div>
  13. <h2>Example</h2>
  14. <code>
  15. // instantiate a loader
  16. var loader = new THREE.BufferGeometryLoader();
  17. // load a resource
  18. loader.load(
  19. // resource URL
  20. 'models/json/pressure.json',
  21. // Function when resource is loaded
  22. function ( geometry ) {
  23. var material = new THREE.MeshLambertMaterial( { color: 0xF5F5F5 } );
  24. var object = new THREE.Mesh( geometry, material );
  25. scene.add( object );
  26. },
  27. // Function called when download progresses
  28. function ( xhr ) {
  29. console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
  30. },
  31. // Function called when download errors
  32. function ( xhr ) {
  33. console.log( 'An error happened' );
  34. }
  35. );
  36. </code>
  37. <h2>Constructor</h2>
  38. <h3>[name]( [page:LoadingManager manager] )</h3>
  39. <div>
  40. [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
  41. </div>
  42. <div>
  43. Creates a new [name].
  44. </div>
  45. <h2>Properties</h2>
  46. <h2>Methods</h2>
  47. <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
  48. <div>
  49. [page:String url] — required<br />
  50. [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:BufferGeometry].<br />
  51. [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 />
  52. [page:Function onError] — Will be called when load errors.<br />
  53. </div>
  54. <div>
  55. Begin loading from url and call onLoad with the parsed response content.
  56. </div>
  57. <h3>[method:BufferGeometry parse]( [page:Object json] )</h3>
  58. <div>
  59. [page:Object json] — The <em>JSON</em> structure to parse.
  60. </div>
  61. <div>
  62. Parse a <em>JSON</em> structure and return a [page:BufferGeometry].
  63. </div>
  64. <h2>Source</h2>
  65. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  66. </body>
  67. </html>