[name]

A loader for loading an .obj resource.

Constructor

[name]([page:LoadingManager manager])

manager — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
Creates a new [name].

Properties

Methods

.load( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )

url — required
onLoad — Will be called when load completes. The argument will be the loaded [page:Object3D object].
onProgress — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
onError — Will be called when load errors.
Begin loading from url and call onLoad with the parsed response content.

.parse([page:String text])

text — The textual obj structure to parse.
Parse an obj text structure and returns an [page:Object3D object].
Found objects are converted to [page:Mesh meshs] with a [page:BufferGeometry BufferGeometry] and a default [page:MeshLambertMaterial MeshLambertMaterial].

Example

webgl_loader_obj

Source

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