Capítulo 196 de 859

Chapter 196: PCDLoader

Core Idea

A loader for the Point Cloud Data (PCD) format.

PCDLoader supports ASCII and (compressed) binary files as well as the following PCD fields:

  • x y z
  • rgb
  • normal_x normal_y normal_z
  • intensity
  • label

Key Concepts

  • littleEndian : boolean: Whether to use little Endian or not.

Code Examples

const loader = new PCDLoader();
const points = await loader.loadAsync( './models/pcd/binary/Zaghetto.pcd' );
points.geometry.center(); // optional
points.geometry.rotateX( Math.PI ); // optional
scene.add( points );
  • What it demonstrates: Typical usage of PCDLoader.

Reference Tables

Constructor

Signature
new PCDLoader( manager : LoadingManager )

Properties

PropertyDescription
.littleEndian : booleanWhether to use little Endian or not.

Methods

MethodDescription
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback )Starts loading from the given URL and passes the loaded PCD asset to the onLoad() callback.
.parse( data : ArrayBuffer ) : PointsParses the given PCD data and returns a point cloud.

Key Takeaways

  1. PCDLoader extends: Loader
  2. Most relevant properties: littleEndian.
  3. Key methods: load, parse.

Connects To