123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <base href="../../" />
- <script src="list.js"></script>
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- <h1>[name]</h1>
- <div class="desc">A loader for loading an <em>.obj</em> resource.</div>
- <h2>Example</h2>
- <code>
- // instantiate the loader
- var loader = new THREE.OBJLoader2();
- // function called on successful load
- var intergrateIntoScene = function ( object ) {
- scene.add( object );
- };
- // load a resource from provided URL
- loader.load( 'obj/female02/female02.obj', intergrateIntoScene );
- </code>
- [example:webgl_loader_obj2]
- <h2>Constructor</h2>
- <h3>[name]( [page:LoadingManager manager] )</h3>
- <div>
- [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
- </div>
- <div>
- Use [name] to load OBJ data from files or to parse OBJ data from arraybuffer or text.
- </div>
- <h2>Properties</h2>
- <h2>Methods</h2>
- <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError], [page:Boolean useArrayBuffer] )</h3>
- <div>
- [page:String url] — URL of the file to load<br />
- [page:Function onLoad] — Called after loading was successfully completed. The argument will be the loaded [page:Object3D].<br />
- [page:Function onProgress] — Called to report progress of loading. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
- [page:Function onError] Called after an error occurred during loading.<br />
- [page:boolean useArrayBuffer] — Set this to false to force string based parsing<br />
- </div>
- <div>
- Use this convenient method to load an OBJ file at the given URL. Per default the fileLoader uses an arraybuffer
- </div>
- <h3>[method:Object3D parse]( [page:ArrayBuffer arrayBuffer] )</h3>
- <div>
- [page:ArrayBuffer arrayBuffer] — OBJ data as Uint8Array
- </div>
- <div>
- Default parse function: Parses OBJ file content stored in arrayBuffer and returns the [page:Object3D sceneGraphBaseNode].
- </div>
- <h3>[method:Object3D parseText]( [page:String test] )</h3>
- <div>
- [page:String text] — OBJ data as string
- </div>
- <div>
- Legacy parse function: Parses OBJ file content stored in string and returns the [page:Object3D sceneGraphBaseNode].
- </div>
- <h3>[method:null setMaterials] ( Array of [page:Material materials] )</h3>
- <div>
- Array of [page:Material materials] — Array of [page:Material Materials] from MTLLoader
- </div>
- <div>
- Set materials loaded by MTLLoader or any other supplier of an Array of [page:Material Materials].
- </div>
- <h3>[method:null setPath] ( [page:String path] )</h3>
- <div>
- [page:String path] — The basePath
- </div>
- <div>
- Base path to use.
- </div>
- <h3>[method:null setSceneGraphBaseNode] ( [page:Object3D sceneGraphBaseNode] )</h3>
- <div>
- [page:Object3D sceneGraphBaseNode] — Scenegraph object where meshes will be attached
- </div>
- <div>
- Set the node where the loaded objects will be attached.
- </div>
- <h3>[method:null setDebug]( [page:Boolean parserDebug], [page:Boolean meshCreatorDebug] )</h3>
- <div>
- [page:Boolean parserDebug] — Internal Parser will produce debug output<br>
- [page:Boolean meshCreatorDebug] — Internal MeshCreator will produce debug output
- </div>
- <div>
- Allows to set debug mode for the parser and the meshCreator.
- </div>
- <h2>Source</h2>
- [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJLoader2.js examples/js/loaders/OBJLoader2.js]
- </body>
- </html>
|