Capítulo 156 de 859

Chapter 156: BufferGeometryLoader

Core Idea

Class for loading geometries. The files are internally loaded via FileLoader.

Code Examples

const loader = new THREE.BufferGeometryLoader();
const geometry = await loader.loadAsync( 'models/json/pressure.json' );
const material = new THREE.MeshBasicMaterial( { color: 0xF5F5F5 } );
const object = new THREE.Mesh( geometry, material );
scene.add( object );
  • What it demonstrates: Typical usage of BufferGeometryLoader.

Reference Tables

Constructor

Signature
new BufferGeometryLoader( manager : LoadingManager )

Methods

MethodDescription
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback )Starts loading from the given URL and pass the loaded geometry to the onLoad() callback.
.parse( json : Object ) : BufferGeometryParses the given JSON object and returns a geometry.

Key Takeaways

  1. BufferGeometryLoader extends: Loader
  2. Key methods: load, parse.

Connects To