PCDLoader.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 a <em>.pcd</em> resource. <br />
  14. Point Cloud Data is a file format for <a href="https://en.wikipedia.org/wiki/Point_Cloud_Library">Point Cloud Library</a>. <br />
  15. Loader support ascii and (compressed) binary.
  16. </p>
  17. <h2>Example</h2>
  18. <code>
  19. // instantiate a loader
  20. var loader = new THREE.PCDLoader();
  21. // load a resource
  22. loader.load(
  23. // resource URL
  24. 'pointcloud.pcd',
  25. // called when the resource is loaded
  26. function ( mesh ) {
  27. scene.add( mesh );
  28. },
  29. // called when loading is in progresses
  30. function ( xhr ) {
  31. console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
  32. },
  33. // called when loading has errors
  34. function ( error ) {
  35. console.log( 'An error happened' );
  36. }
  37. );
  38. </code>
  39. [example:webgl_loader_pcd]
  40. <h2>Constructor</h2>
  41. <h3>[name]( [param:LoadingManager manager] )</h3>
  42. <p>
  43. [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
  44. </p>
  45. <p>
  46. Creates a new [name].
  47. </p>
  48. <h2>Properties</h2>
  49. <p>See the base [page:Loader] class for common properties.</p>
  50. <h3>[page:Boolean littleEndian]</h3>
  51. <p>
  52. Default value is true.
  53. </p>
  54. <h2>Methods</h2>
  55. <p>See the base [page:Loader] class for common methods.</p>
  56. <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
  57. <p>
  58. [page:String url] — A string containing the path/URL of the <em>.pcd</em> file.<br />
  59. [page:Function onLoad] — (optional) A function to be called after loading is successfully completed. The function receives loaded [page:Object3D] as an argument.<br />
  60. [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 />
  61. [page:Function onError] — (optional) A function to be called if an error occurs during loading. The function receives the error as an argument.<br />
  62. </p>
  63. <p>
  64. Begin loading from url and call onLoad with the parsed response content.
  65. </p>
  66. <h3>[method:Object3D parse]( [param:Arraybuffer data],[param:String url] )</h3>
  67. <p>
  68. [page:Arraybuffer data] — The binary structure to parse.
  69. </p>
  70. <p>
  71. [page:String url] — The file name or file url.
  72. </p>
  73. <p>
  74. Parse an <em>pcd</em> binary structure and return an [page:Object3D].<br />
  75. The object is converted to [page:Points] with a [page:BufferGeometry] and a [page:PointsMaterial].
  76. </p>
  77. <h2>Source</h2>
  78. <p>
  79. [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/PCDLoader.js examples/js/loaders/PCDLoader.js]
  80. </p>
  81. </body>
  82. </html>