From 18c6f4f9ab698ffa3cfe7f63eddc45429237e892 Mon Sep 17 00:00:00 2001 From: Vincent Lark Date: Fri, 10 Oct 2014 02:11:24 +0200 Subject: [PATCH] loaders documentation: xhrloader, objloader, mtlloader --- docs/api/loaders/MTLLoader.html | 56 +++++++++++++++++++++ docs/api/loaders/OBJLoader.html | 60 +++++++++++++++++++++++ docs/api/loaders/XHRLoader.html | 86 +++++++++++++++++++++------------ docs/list.js | 4 +- 4 files changed, 175 insertions(+), 31 deletions(-) create mode 100644 docs/api/loaders/MTLLoader.html create mode 100644 docs/api/loaders/OBJLoader.html diff --git a/docs/api/loaders/MTLLoader.html b/docs/api/loaders/MTLLoader.html new file mode 100644 index 0000000000..8140a6018e --- /dev/null +++ b/docs/api/loaders/MTLLoader.html @@ -0,0 +1,56 @@ + + + + + + + + + + +

[name]

+ +
A loader for loading an .obj resource.
+ + +

Constructor

+ +

[name]([page:String baseUrl], [page:Object options], [page:String crossOrigin])

+
+ baseUrl — The base url from which to find subsequent resources.
+ options — Options passed to the created material (side, wrap, normalizeRGB, ignoreZeroRGBs, invertTransparency).
+ crossOrigin — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
+
+
+ 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:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.
+ 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 return the loaded material. +
+ +

.parse([page:String text])

+
+ text — The textual obj structure to parse. +
+
+ Parse a mtl text structure and returns a [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.
+
+ +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/[name].js examples/js/loaders/[name].js] + + diff --git a/docs/api/loaders/OBJLoader.html b/docs/api/loaders/OBJLoader.html new file mode 100644 index 0000000000..d339c80aee --- /dev/null +++ b/docs/api/loaders/OBJLoader.html @@ -0,0 +1,60 @@ + + + + + + + + + + +

[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 return the [page:String text] response that will contain the data. +
+ +

.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

+ + [link:http://threejs.org/examples/#webgl_loader_obj] + + +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJLoader.js examples/js/loaders/OBJLoader.js] + + diff --git a/docs/api/loaders/XHRLoader.html b/docs/api/loaders/XHRLoader.html index 9d8440d511..2a6030d93c 100644 --- a/docs/api/loaders/XHRLoader.html +++ b/docs/api/loaders/XHRLoader.html @@ -1,46 +1,72 @@ - - - - - - - -

[name]

+ + + + + + + -
todo
+

[name]

-

Example

+
A low level class for loading resources with XmlHttpRequest.
- todo -

Constructor

+

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]. +
-

todo

-
+

Properties

-

Properties

+

.[page:Cache cache]

+
+ A [page:Cache cache] instance that hold the response from each request made through this loader, so each file is requested once. +
-

todo

-
- todo -
+

.[page:string crossOrigin]

+
+ The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. +
+

.[page:string responseType]

+
+ Can be set to change the response type. +
-

Methods

- -

todo

-
todo
-
- todo -
- -

Source

+

Methods

- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] - +

.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 text response.
+ 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 return the [page:String text] response that will contain the data. +
+ +

.setCrossOrigin([page:String value]

+
+ value — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. +
+ +

.setResponseType([page:String value]

+
+ value — the empty string (default), "arraybuffer", "blob", "document", "json", or "text". +
+ +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] + diff --git a/docs/list.js b/docs/list.js index feb505e931..8a67a0500d 100644 --- a/docs/list.js +++ b/docs/list.js @@ -53,6 +53,8 @@ var list = { [ "Loader", "api/loaders/Loader" ], [ "LoadingManager", "api/loaders/LoadingManager" ], [ "MaterialLoader", "api/loaders/MaterialLoader" ], + [ "OBJLoader", "api/loaders/OBJLoader" ], + [ "MTLLoader", "api/loaders/MTLLoader" ], [ "ObjectLoader", "api/loaders/ObjectLoader" ], [ "TextureLoader", "api/loaders/TextureLoader" ], [ "XHRLoader", "api/loaders/XHRLoader" ] @@ -157,7 +159,7 @@ var list = { [ "CubeCamera", "api/extras/cameras/CubeCamera" ] ], - + "Extras / Core": [ [ "Curve", "api/extras/core/Curve" ], [ "CurvePath", "api/extras/core/CurvePath" ], -- GitLab