[name]

A loader for loading a .obj resource.
The OBJ file format is a simple data-format that represents 3D geometry in a human readable format as, the position of each vertex, the UV position of each texture coordinate vertex, vertex normals, and the faces that make each polygon defined as a list of vertices, and texture vertices.

Examples

// instantiate the loader let objLoader2Parallel = new OBJLoader2Parallel(); // define where to attach the data let local = new THREE.Object3D(); // function called on successful completion of parsing function callbackOnLoad( object3d, message ) { local.add( object3d ); } // load a resource from provided URL in parallel to Main objLoader2Parallel.load( 'models/obj/walt/WaltHead.obj', callbackOnLoad, null, null, null ); [example:webgl_loader_obj2_options] - Example for multiple use-cases (parse and load, sync (see [page:OBJLoader2]) or in parallel to main)

Constructor

[name]( [param:LoadingManager manager] )

[page:LoadingManager manager] - The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].

Creates a new [name]. Use it to load OBJ data from files or to parse OBJ data from arraybuffer. It extends [page:OBJLoader2] with the capability to run the parser in a web worker.

Properties

See the base [page:OBJLoader2] class for common properties.

Methods

See the base [page:OBJLoader2] class for common methods.

[method:Object3D parse]

See [page:OBJLoader2.parse].
The callback [page:OBJLoader2.setCallbackOnLoad OBJLoader2.onLoad] needs to be set to be able to receive the content if used in parallel mode. Fallback is possible via [page:OBJLoader2Parallel.setExecuteParallel].

[method:null load]

See [page:OBJLoader2.load].

[method:OBJLoader2Parallel setExecuteParallel] ( [param:boolean executeParallel] )

[page:boolean executeParallel] - True or False

Execution of parse in parallel via Worker is default, but synchronous [page:OBJLoader2] parsing can be enforced via false here.

[method:OBJLoader2Parallel setPreferJsmWorker] ( [param:boolean preferJsmWorker] )

[page:boolean preferJsmWorker] - True or False

Set whether jsm modules in workers should be used. This requires browser support which is currently only experimental.

[method:WorkerExecutionSupport getWorkerExecutionSupport] ()

Allow to get hold of [page:WorkerExecutionSupport] for configuration purposes.

[method:CodeBuilderInstructions buildWorkerCode] ()

Provide instructions on what is to be contained in the worker.

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/OBJLoader2Parallel.js examples/jsm/loaders/OBJLoader2Parallel.js]