| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <!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>
- <p class="desc">A loader for loading a <em>.obj</em> resource.<br />
- The <a href="https://en.wikipedia.org/wiki/Wavefront_.obj_file">OBJ file format</a> 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.
- </p>
- <h2>Examples</h2>
- <code>
- // 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 );
- </code>
- [example:webgl_loader_obj2_options] - Example for multiple use-cases (parse and load, sync (see [page:OBJLoader2]) or in parallel to main)<br>
- <h2>Constructor</h2>
- <h3>[name]( [param:LoadingManager manager] )</h3>
- <p>
- [page:LoadingManager manager] - The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br>
- </p>
- <p>
- Creates a new [name]. Use it to load OBJ data from files or to parse OBJ data from arraybuffer or text.
- </p>
- <h2>Methods</h2>
- <h3>[method:Object3D parse]( [param:arraybuffer content]|[param:String content] )</h3>
- <p>
- [[page:arraybuffer content]|[page:String content]] OBJ data as Uint8Array or String
- </p>
- <p>
- Parses OBJ data synchronously from arraybuffer or string and returns the [page:Object3D loaderRoorNode].
- </p>
- <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError], [param:Function onMeshAlter], [param:boolean useAsync] )</h3>
- <p>
- [page:String url] - A string containing the path/URL of the file to be loaded.<br>
- [page:Function onLoad] - A function to be called after loading is successfully completed. The function receives loaded [page:Object3D] as an argument.<br>
- [page:Function onProgress] - (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, which contains [page:Integer total] and [page:Integer loaded] bytes.<br>
- [page:Function onError] - (optional) A function to be called if an error occurs during loading. The function receives the error as an argument.<br>
- [page:Function onMeshAlter] - (optional) A function to be called after a new mesh raw data becomes available for alteration.<br>
- [page:boolean useAsync] - (optional) If true, uses async loading with worker, if false loads data synchronously.
- </p>
- <p>
- Use this convenient method to load a file at the given URL. By default the fileLoader uses an ArrayBuffer.
- </p>
- <h2>Source</h2>
- <p>
- [link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/OBJLoader2Parallel.js examples/jsm/loaders/OBJLoader2.js]
- </p>
- </body>
- </html>
|