diff --git a/docs/api/loaders/BabylonLoader.html b/docs/api/loaders/BabylonLoader.html new file mode 100644 index 0000000000000000000000000000000000000000..634fd8be2b92e252cf44fcf97dc7f483e473c9f6 --- /dev/null +++ b/docs/api/loaders/BabylonLoader.html @@ -0,0 +1,84 @@ + + + + + + + + + + +

[name]

+ +
A loader for loading a .babylon resource.
+ + +

Constructor

+ +

[name]( [page:LoadingManager manager] )

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

Properties

+ + +

Methods

+ +

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

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

[method:Object3D parse]( [page:Object json] )

+
+ [page:Object json] — The JSON structure to parse. +
+
+ Parse a JSON structure and return an [page:Object3D object] or a [page:Scene scene].
+ Found objects are converted to [page:Mesh] with a [page:BufferGeometry] and a default [page:MeshPhongMaterial].
+ Lights are parsed accordingly. +
+ +

Example

+ + + // instantiate a loader + var loader = new THREE.BabylonLoader(); + + // load a Babylon resource + loader.load( + // resource URL + 'models/babylon/skull.babylon', + // Function when resource is loaded + function ( object ) { + scene.add( object ); + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when download errors + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + + + [example:webgl_loader_babylon] + + +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/BabylonLoader.js examples/js/loaders/BabylonLoader.js] + + diff --git a/docs/api/loaders/BufferGeometryLoader.html b/docs/api/loaders/BufferGeometryLoader.html index 9d8440d511e3d5b4941ada170562729bc43f4888..fc06883dde7015d4bca1e06baa9c2623574aa96b 100644 --- a/docs/api/loaders/BufferGeometryLoader.html +++ b/docs/api/loaders/BufferGeometryLoader.html @@ -9,36 +9,72 @@

[name]

-
todo
+
A loader for loading a [page:BufferGeometry].
-

Example

- - todo

Constructor

- -

todo

-
+

[name]( [page:LoadingManager manager] )

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

Properties

-

todo

-
- todo -
-

Methods

- -

todo

-
todo
+

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

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

[method:BufferGeometry parse]( [page:Object json] )

- todo + [page:Object json] — The JSON structure to parse.
- +
+ Parse a JSON structure and return a [page:BufferGeometry]. +
+ + +

Example

+ + + // instantiate a loader + var loader = new THREE.BufferGeometryLoader(); + + // load a resource + loader.load( + // resource URL + 'models/json/pressure.json', + // Function when resource is loaded + function ( geometry ) { + var material = new THREE.MeshLambertMaterial( { color: 0xF5F5F5 } ); + var object = new THREE.Mesh( geometry, material ); + scene.add( object ); + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when download errors + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + +

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/loaders/Cache.html b/docs/api/loaders/Cache.html index 9d8440d511e3d5b4941ada170562729bc43f4888..a478230aa97f3d0a1b985698f46e74bf93a049f3 100644 --- a/docs/api/loaders/Cache.html +++ b/docs/api/loaders/Cache.html @@ -9,36 +9,58 @@

[name]

-
todo
+
A simple caching classe, used internaly by [page:XHRLoader].
-

Example

- - todo

Constructor

- -

todo

-
+

[name]()

+
+ Creates a new [name]. +

Properties

-

todo

+

[property:Object files]

- todo -
+ An [page:Object object] that hold cached values. +

Methods

- -

todo

-
todo
+

[method:null add]( [page:String key], value )

+
+ [page:String key] — required. A string key
+ [page:Object] value —
+
+
+ Adds a cache entry with that key to hold the value. If this key already holds a value, it is overwritten. +
+ +

[method:null get]( [page:String key] )

+
+ [page:String key] — required. A string key
+
+
+ Get the value of key. If the key does not exist the null value is returned. +
+ +

[method:null remove]( [page:String key] )

+
+ [page:String key] — required. A string key
+
- todo + Remove the cached value associated with the key.
- + +

[method:null clear]()

+
+ Remove all values from the cache. +
+ +

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/loaders/ColladaLoader.html b/docs/api/loaders/ColladaLoader.html new file mode 100644 index 0000000000000000000000000000000000000000..823325357ee8864c9fcdbd8dac14a6f64d24adaa --- /dev/null +++ b/docs/api/loaders/ColladaLoader.html @@ -0,0 +1,114 @@ + + + + + + + + + + +

[name]

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

Constructor

+ +

[name]()

+
+ Creates a new [name]. +
+ + +

Properties

+ +

[property:Array options]

+
+  .[page:Boolean centerGeometry] — Force [page:Geometry] to always be centered at the local origin of the containing [page: Mesh].
+  .[page:Boolean convertUpAxis] — Axis conversion is done for geometries, animations, and controllers.
+  .[page:Boolean subdivideFaces] — Force subdivision into multiple [page: Face3].
+  .[page:String upAxis] — X, Y or Z
+  .[page:Boolean defaultEnvMap] — Cubemap to use for reflective or refractive materials.
+
+ +

[property:Object geometries]

+
+ Parsed .dae geometries. +
+ + +

Methods

+ +

[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress] )

+
+ [page:String url] — required
+ [page:function onLoad] — Will be called when load completes. The argument will be an [page:Object object] containing loaded resources.
+ [page:function onProgress] — Will be called while load progresses. The argument will be an object containing .[page:Integer total] and .[page:Integer loaded] bytes.
+
+
+ Begin loading from url and call onLoad with the parsed response content. +
+ +

[method:Object parse]( [page:Document doc], [page:Function callBack], [page:String url] )

+
+ [page:Document doc] — The XML document to parse.
+ [page:Function callBack] — Will be called when parse completes.
+ [page:String url] — The base url from which to find subsequent resources.
+
+
+ Parse an XML Document and return an [page:Object object] that contain loaded parts: .[page:Scene scene], .[page:Array morphs], .[page:Array skins], .[page:Array animations], .[page:Object dae] +
+ +

[method:null setPreferredShading]( [page:Integer shading] )

+
+ [page:Integer shading] — required +
+
+ Set the .[page:Integer shading] property on the resource's materials.
+ Options are [page:Materials THREE.SmoothShading], [page:Materials THREE.FlatShading], [page:Materials THREE.NoShading]. +
+ +

[method:null applySkin]( [page:Geometry geometry], [page:Object instanceCtrl], [page:Integer frame] )

+
+ [page:Geometry geometry] — required
+ [page:Object instanceCtrl] — required. A collada skinController
+ [page:Integer frame] — optionnal. Default is 40
+
+
+ Apply a skin (vertices, animation, bones) from a collada skin controller, on the given [page:Geometry]. +
+ + +

Example

+ + + // instantiate a loader + var loader = new THREE.ColladaLoader(); + + // load a Babylon resource + loader.load( + // resource URL + 'models/collada/monster/monster.dae', + // Function when resource is loaded + function ( collada ) { + scene.add( collada.scene ); + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + } + ); + + + [example:webgl_loader_collada]
+ [example:webgl_loader_collada_keyframe]
+ [example:webgl_loader_collada_skinning]
+ [example:webgl_loader_collada_kinematics] + + +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJLoader.js examples/js/loaders/BabylonLoader.js] + + diff --git a/docs/api/loaders/ImageLoader.html b/docs/api/loaders/ImageLoader.html index 4625d71593c68a239cb1b5dee58b72446fc2cd6f..de19a204e506d4357a8153f2626c4cd0932e0754 100644 --- a/docs/api/loaders/ImageLoader.html +++ b/docs/api/loaders/ImageLoader.html @@ -9,46 +9,79 @@

[name]

-
A loader for loading an [page:Image image].
+
A loader for loading an [page:Image].
-

Constructor

+

Constructor

-

[name]([page:LoadingManager manager])

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

[name]( [page:LoadingManager manager] )

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

Properties

-

[property:string crossOrigin]

+

[property:String crossOrigin]

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

Methods

-

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

+

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

- onLoad -- Will be called when load completes. The argument will be the loaded Imageloader. - onProgress -- Will be called while load progresses. The argument will be the progress event. - onError -- Will be called when load errors. - url — required + [page:String url] — required
+ [page:Function onLoad] — Will be called when load completes. The argument will be the loaded Imageloader.
+ [page:Function onProgress] — Will be called while load progresses. The argument will be the progress event.
+ [page:Function onError] — Will be called when load errors.
- Begin loading from url and return the [page:Image image] object that will contain the data. -
+ Begin loading from url and return the [page:Image image] object that will contain the data. + -

[method:todo setCrossOrigin]([page:String value])

+

[method:null setCrossOrigin]( [page:String value] )

- value -- The crossOrigin string. + [page:String value] — The crossOrigin string.
- The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. -
+ The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. + + +

Example

+ + + // instantiate a loader + var loader = new THREE.ImageLoader(); + + // load a image resource + loader.load( + // resource URL + 'textures/skyboxsun25degtest.png', + // Function when resource is loaded + function ( image ) { + // do something with it + + // like drawing a part of it on a canvas + var canvas = document.createElement( 'canvas' ); + var context = canvas.getContext( '2d' ); + context.drawImage( image, 100, 100 ); + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when download errors + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + + + [example:webgl_shaders_ocean] +

Source

diff --git a/docs/api/loaders/JSONLoader.html b/docs/api/loaders/JSONLoader.html index 184fba64bc55292fe5a313c2f1a4a58835c3b53d..58c077d2d0c70fec1bb110e8404c4b5406491e4f 100644 --- a/docs/api/loaders/JSONLoader.html +++ b/docs/api/loaders/JSONLoader.html @@ -15,54 +15,148 @@

Constructor

- -

[name]([page:Boolean showStatus])

+

[name]( [page:Boolean showStatus] )

- showStatus -- todo + [page:Boolean showStatus] — Show the status of loading div.
- todo + Creates a new [name].
- -

Properties

+

Properties

+

[property:boolean withCredentials]

- todo -
+ If true, the ajax request will use cookies. + + + +

Properties inherited from [page:Loader]

+ +

[property:Boolean showStatus]

+
If true, show loading status in the statusDomElement.
+ +

[property:DOMElement statusDomElement]

+
This is the recipient of status messages.
+ +

[property:Function onLoadStart]

+
Will be called when load starts.
+
The default is a function with empty body.
+ + + +

[property:Function onLoadComplete]

+
Will be called when load completes.
+
The default is a function with empty body.
+

Methods

-

[method:todo load]( [page:String url], [page:Function callback], [page:String texturePath] )

+

[method:null load]( [page:String url], [page:Function callback], [page:String texturePath] )

+
+ [page:String url] — required
+ [page:Function callback] — required. Will be called when load completes. The arguments will be the loaded [page:Object3D] and the loaded [page:Array materials].
+ [page:String texturePath] — optional. If not specified, textures will be assumed to be in the same folder as the Javascript model file. +
+ +

[method:null loadAjaxJSON]([page:JSONLoader context], [page:String url], [page:Function callback], [page:String texturePath], [page:Function callbackProgress])

+
+ [page:JSONLoader context] — The [page:JSONLoader] instance
+ [page:String url] — required
+ [page:Function callback] — required. This function will be called with the loaded model as an instance of [page:Geometry geometry] when the load is completed.
+ [page:String texturePath] — Base path for textures.
+ [page:Function callbackProgress] — Will be called while load progresses. The argument will be an [page:Object] containing two attributes: .[page:Integer total] and .[page:Integer loaded] bytes. +
+
+ Begin loading from url and call callback with the parsed response content. +
+ +

[method:Object3D parse]( [page:Object json], [page:String texturePath] )

- url — required
- callback — required. This function will be called with the loaded model as an instance of [page:Geometry geometry] when the load is completed.
- texturePath — optional. If not specified, textures will be assumed to be in the same folder as the Javascript model file. + [page:String json] — JSON object to parse.
+ [page:String texturePath] — Base path for textures. +
+
+ Parse a JSON structure and return an [page:Object] containing the parsed .[page:Geometry] and .[page:Array materials].
+

Methods inherited from [page:Loader]

-

[method:todo parse]([page:todo json], [page:todo texturePath])

+

[method:Boolean needsTangents]( [page:Array materials] )

- json -- todo
- texturePath -- todo + [page:Array materials] — an array of [page:Material]
- todo + Checks if the loaded object needs tangents based on its materials.
-

[method:todo loadAjaxJSON]([page:todo context], [page:todo url], [page:todo callback], [page:todo texturePath], [page:todo callbackProgress])

+

[method:null updateProgress]( [page:object progress] )

- context -- todo
- url -- todo
- callback -- todo
- texturePath -- todo
- callbackProgress -- todo + [page:Object progress] — an object containing loaded(contains the amount of bytes loaded) and optionally total (containing the total amount of bytes).
- todo + Updates the DOM object with the progress made.
+

[method:Material createMaterial]( [page:object m], [page:string texturePath] )

+
+ [page:Object m] — The parameters to create the material.
+ [page:String texturePath] — The base path of the textures. +
+
+ Creates the Material based on the parameters m. +
+ +

[method:Array initMaterials]( [page:Array materials], [page:string texturePath] )

+
+ [page:Array materials] — an array of parameters to create materials.
+ [page:String texturePath] — The base path of the textures. +
+
+ Creates an array of [page:Material] based on the array of parameters m. The index of the parameters decide the correct index of the materials. +
+ +

[method:String extractUrlBase]( [page:string url] )

+
+ [page:String url] — The url to extract the base url from. +
+
+ Extract the base from the URL. +
+ +

[method:DOMElement addStatusElement]()

+
+ Add a DOM element to indicate the progress and return the DOMElement +
+ + +

Example

+ + + // instantiate a loader + var loader = new THREE.JSONLoader(); + + // load a resource + loader.load( + // resource URL + 'models/animated/monster/monster.js', + // Function when resource is loaded + function ( geometry, materials ) { + var material = new THREE.MeshFaceMaterial( materials ); + var object = new THREE.Mesh( geometry, material ); + scene.add( object ); + } + ); + + + [example:webgl_loader_json_blender] + +

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/loaders/Loader.html b/docs/api/loaders/Loader.html index f4a3cecd5120884250dcbbb34efe2d1df3b61cbe..989f4db35cfd700716bc123c7022891ff10bf7ed 100644 --- a/docs/api/loaders/Loader.html +++ b/docs/api/loaders/Loader.html @@ -15,9 +15,9 @@

Constructor

-

[name]([page:Boolean showStatus])

+

[name]( [page:Boolean showStatus] )

- showStatus -- Show the status of loading div. + [page:Boolean showStatus] — Show the status of loading div.
Creates a new [name]. This should be called as base class. @@ -28,10 +28,10 @@

[property:Boolean showStatus]

If true, show loading status in the statusDomElement.
- +

[property:DOMElement statusDomElement]

This is the recipient of status messages.
- +

[property:Function onLoadStart]

Will be called when load starts.
The default is a function with empty body.
@@ -39,63 +39,63 @@

[property:Function onLoadProgress]

Will be called while load progresses.
The default is a function with empty body.
- +

[property:Function onLoadComplete]

Will be called when load completes.
The default is a function with empty body.
- +

[property:string crossOrigin]

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

Methods

-

[method:Boolean needsTangents]([page:Array materials])

+

[method:Boolean needsTangents]( [page:Array materials] )

- materials -- an array of [page:Material] + [page:Array materials] — an array of [page:Material]
Checks if the loaded object needs tangents based on its materials.
-

[method:todo updateProgress]([page:object progress])

+

[method:null updateProgress]( [page:object progress] )

- progress -- an object containing loaded(contains the amount of bytes loaded) and optionally total (containing the total amount of bytes). + [page:Object progress] — an object containing loaded(contains the amount of bytes loaded) and optionally total (containing the total amount of bytes).
Updates the DOM object with the progress made.
-

[method:Material createMaterial]([page:object m], [page:string texturePath])

+

[method:Material createMaterial]( [page:object m], [page:string texturePath] )

- m -- The parameters to create the material.
- texturePath -- The base path of the textures. + [page:Object m] — The parameters to create the material.
+ [page:String texturePath] — The base path of the textures.
Creates the Material based on the parameters m.
-

[method:Array initMaterials]([page:Array materials], [page:string texturePath])

+

[method:Array initMaterials]( [page:Array materials], [page:string texturePath] )

- materials -- an array of parameters to create materials.
- texturePath -- The base path of the textures. + [page:Array materials] — an array of parameters to create materials.
+ [page:String texturePath] — The base path of the textures.
Creates an array of [page:Material] based on the array of parameters m. The index of the parameters decide the correct index of the materials.
-

[method:todo extractUrlBase]([page:string url])

+

[method:String extractUrlBase]( [page:string url] )

- url -- The url to extract the base url from. + [page:String url] — The url to extract the base url from.
- Extract the base from the URL. + Extract the base from the URL.

[method:DOMElement addStatusElement]()

- Add a DOM element to indicate the progress and returns the DOMElement + Add a DOM element to indicate the progress and return the DOMElement
diff --git a/docs/api/loaders/LoadingManager.html b/docs/api/loaders/LoadingManager.html index f53244b7b6ff69d59d09e926a6b0caef54bc2754..2d28044bd03c7a79c7225ca31cb861f7e0c56cc7 100644 --- a/docs/api/loaders/LoadingManager.html +++ b/docs/api/loaders/LoadingManager.html @@ -11,71 +11,78 @@
Handles and keeps track of loaded and pending data.
-var manager = new THREE.LoadingManager(); -manager.onProgress = function ( item, loaded, total ) { + var manager = new THREE.LoadingManager(); + manager.onProgress = function ( item, loaded, total ) { - console.log( item, loaded, total ); + console.log( item, loaded, total ); -}; + }; -var loader = new THREE.OBJLoader( manager ); -loader.load( 'file.obj', function ( object ) { + var loader = new THREE.OBJLoader( manager ); + loader.load( 'file.obj', function ( object ) { - // + // -} ); + } ); +

Constructor

-

[name]([page:function onLoad], [page:function onProgress], [page:function onError])

+

[name]( [page:Function onLoad], [page:Function onProgress], [page:Function onError] )

- [page:function onLoad] -- The function that needs to be called when all loaders are done. - [page:function onProgress] -- The function that needs to be called when an item is complete. - [page:function onError] -- The function that needs to be called when an item is errors. + [page:Function onLoad] — The function that needs to be called when all loaders are done.
+ [page:Function onProgress] — The function that needs to be called when an item is complete.
+ [page:Function onError] — The function that needs to be called when an item is errors.
Creates a [name].
- - + +

Properties

-

[property:function onLoad]

+

[property:Function onLoad]

- The function that needs to be called when all loaders are done. -
+ The function that needs to be called when all loaders are done. + -

[property:function onProgress]

+

[property:Function onProgress]

The function that needs to be called when an item is complete. The arguments are url(The url of the item just loaded),
loaded(the amount of items already loaded), total( The total amount of items to be loaded.) -
+ -

[property:function onError]

+

[property:Function onError]

The function that needs to be called when an item errors. -
- - + + +

Methods

-

[method:todo itemStart]( [page:String url] )

+

[method:null itemStart]( [page:String url] )

- url — the url to load + [page:String url] — the url to load
This should be called by any loader used by the manager when the loader starts loading an url. These shouldn't be called outside a loader.
-

[method:todo itemEnd]( [page:String url] )

+

[method:null itemEnd]( [page:String url] )

- url — the url to load + [page:String url] — the loaded url
This should be called by any loader used by the manager when the loader ended loading an url. These shouldn't be called outside a loader.
+ +

Example

+ + [example:webgl_loader_obj] + +

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/loaders/MTLLoader.html b/docs/api/loaders/MTLLoader.html new file mode 100644 index 0000000000000000000000000000000000000000..122c1ae79816b3cb6ae11dc38087ee3a17e04681 --- /dev/null +++ b/docs/api/loaders/MTLLoader.html @@ -0,0 +1,56 @@ + + + + + + + + + + +

[name]

+ +
A loader for loading an .mtl resource, used internaly by [page:OBJMTLLoader] and [page:UTF8Loader].
+ + +

Constructor

+ +

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

+
+ [page:String baseUrl] — The base url from which to find subsequent resources.
+ [page:Object options] — Options passed to the created material (side, wrap, normalizeRGB, ignoreZeroRGBs, invertTransparency).
+ [page:String crossOrigin] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
+
+
+ Creates a new [name]. +
+ +

Properties

+ + +

Methods

+ +

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

+
+ [page:String url] — required
+ [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.
+ [page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
+ [page:Function onError] — Will be called when load errors.
+
+
+ Begin loading from url and return the loaded material. +
+ +

[method:MTLLoaderMaterialCreator parse]( [page:String text] )

+
+ [page:String text] — The textual mtl structure to parse. +
+
+ Parse a mtl text structure and return a [page:MTLLoaderMaterialCreator] 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/MaterialLoader.html b/docs/api/loaders/MaterialLoader.html index 34132336fd1959043db63a61dbae17723bddae1f..dc37d2a2f5067c446b574aa321ab2b3beaae57cf 100644 --- a/docs/api/loaders/MaterialLoader.html +++ b/docs/api/loaders/MaterialLoader.html @@ -9,15 +9,15 @@

[name]

-
A loader for loading an [page:Material material].
+
A loader for loading a [page:Material] in JSON format.
-

Constructor

+

Constructor

-

[name]([page:LoadingManager manager])

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

[name]( [page:LoadingManager manager] )

+
+ [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager]. +
Creates a new [name].
@@ -25,32 +25,60 @@

Methods

-

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

+

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

- onLoad -- Will be called when load completes. The argument will be the loaded Imageloader. - onProgress -- Will be called while load progresses. The argument will be the progress event. - onError -- Will be called when load errors. - url — required + [page:String url] — required
+ [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Material].
+ [page:Function onProgress] — Will be called while load progresses. The argument will be the progress event.
+ [page:Function onError] — Will be called when load errors.
- Begin loading from url and return the [page:Material material] object that will contain the data. -
+ Begin loading from url and return the [page:Material] object that will contain the data. + -

[method:todo setCrossOrigin]([page:String value])

+

[method:null setCrossOrigin]( [page:String value] )

- value -- The crossOrigin string. + [page:String value] — The crossOrigin string.
- The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. -
+ The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS. + -

[method:todo parse]([page:Object json])

-
- json -- The json object containing the parameters of the Material. +

[method:Material parse]( [page:Object json] )

+
+ [page:Object json] — The json object containing the parameters of the Material.
- Creates a new [page:Material material] of the type 'json.type' and with parameters defined in the json object. -
+ Parse a JSON structure and create a new [page:Material] of the type [page:String json.type] with parameters defined in the json object. +
+ + +

Example

+ + + + // instantiate a loader + var loader = new THREE.MaterialLoader(); + + // load a resource + loader.load( + // resource URL + 'path/to/material.json', + // Function when resource is loaded + function ( material ) { + object.material = material; + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when download errors + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + +

Source

diff --git a/docs/api/loaders/OBJLoader.html b/docs/api/loaders/OBJLoader.html new file mode 100644 index 0000000000000000000000000000000000000000..fbfc20e29861fcbe1496ece77f1f03bc149565f4 --- /dev/null +++ b/docs/api/loaders/OBJLoader.html @@ -0,0 +1,75 @@ + + + + + + + + + + +

[name]

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

Constructor

+ +

[name]( [page:LoadingManager manager] )

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

Properties

+ + +

Methods

+ +

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

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

[method:Object3D parse]( [page:String text] )

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

Example

+ + + // instantiate a loader + var loader = new THREE.OBJLoader(); + + // load a resource + loader.load( + // resource URL + 'models/skinned/UCS_config.json', + // Function when resource is loaded + function ( object ) { + scene.add( object ); + } + ); + + + [example: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/OBJMTLLoader.html b/docs/api/loaders/OBJMTLLoader.html new file mode 100644 index 0000000000000000000000000000000000000000..e87c1a283d94f756ed3b98228c13eee45e387599 --- /dev/null +++ b/docs/api/loaders/OBJMTLLoader.html @@ -0,0 +1,87 @@ + + + + + + + + + + +

[name]

+ +
A loader for loading a .obj and its .mtl together.
+ + +

Constructor

+ +

[name]( [page:LoadingManager manager] )

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

Properties

+ + +

Methods

+ +

[method:null load]( [page:String objUrl], [page:String mtlUrl], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )

+
+ [page:String objUrl] — required. URL to the .obj resource
+ [page:String mtlUrl] — required. URL to the .mtl resource
+ [page:Function onLoad] — Will be called when both resources load complete. The argument will be the loaded [page:Object3D].
+ [page:Function onProgress] — Will be called while both load progress. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
+ [page:Function onError] — Will be called when load errors.
+
+
+ Begin loading from urls and call onLoad with the parsed response content. +
+ +

[method:Object3D parse]( [page:String text], [page:Function mtllibCallback] )

+
+ [page:String text] — required. The textual obj structure to parse.
+ [page:Function mtllibCallback] — optional. Callback to handle mtllib declaration.
+
+
+ Parse an obj text structure and return an [page:Object3D].
+ Found objects are converted to [page:Mesh] with a [page:BufferGeometry] and materials are converted to [page:MeshLambertMaterial]. +
+ +

Example

+ + + // instantiate a loader + var loader = new THREE.OBJMTLLoader(); + + // load an obj / mtl resource pair + loader.load( + // OBJ resource URL + 'obj/male02/male02.obj', + // MTL resource URL + 'obj/male02/male02_dds.mtl', + // Function when both resources are loaded + function ( object ) { + scene.add( object ); + }, + // Function called when downloads progress + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when downloads error + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + + + [example:webgl_loader_obj_mtl] + + +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/OBJMTLLoader.js examples/js/loaders/OBJMTLLoader.js] + + diff --git a/docs/api/loaders/ObjectLoader.html b/docs/api/loaders/ObjectLoader.html index 9d8440d511e3d5b4941ada170562729bc43f4888..bed59f56de10459e55fb7883bb83f671b59494ce 100644 --- a/docs/api/loaders/ObjectLoader.html +++ b/docs/api/loaders/ObjectLoader.html @@ -9,36 +9,66 @@

[name]

-
todo
+
A loader for loading a JSON resource. Unlike the [page:JSONLoader], this one make use of the .type attributes of objects to map them to their original classes.
-

Example

- - todo

Constructor

- -

todo

-
+

[name]( [page:LoadingManager manager] )

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

Properties

-

todo

+ +

Methods

+ +

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

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

Methods

- +

[method:Object3D parse]( [page:Object json] )

+
+ [page:Object json] — required. The JSON source to parse
+
+
+ Parse a JSON content and return a threejs object. +
-

todo

-
todo
+

[method:null setCrossOrigin]( [page:String value] )

- todo + [page:String value] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
- + + +

Example

+ + + // instantiate a loader + var loader = new THREE.ObjectLoader(); + + // assuming we loaded a JSON structure from elsewhere + var object = loader.parse( a_json_object ); + + scene.add( object ); + + + [example:webgl_loader_msgpack] + +

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/loaders/PDBLoader.html b/docs/api/loaders/PDBLoader.html new file mode 100644 index 0000000000000000000000000000000000000000..3118ac0fb0876d4674e54648028dd0473cc6446f --- /dev/null +++ b/docs/api/loaders/PDBLoader.html @@ -0,0 +1,95 @@ + + + + + + + + + + +

[name]

+ +
+ A loader for loading a .pdb resource. +

+ The Protein Data Bank file format is a textual file format describing the three-dimensional structures of molecules. +
+ + +

Constructor

+ +

[name]( [page:LoadingManager manager] )

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

Properties

+ + +

Methods

+ +

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

+
+ [page:String url] — required. URL to the .pdb file
+ [page:Function onLoad] — Will be called when load completes. The arguments will be an [page:Geometry geometryAtoms], [page:Geometry geometryBonds] and the [page:Object JSON] structure.
+ [page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
+ [page:Function onError] — Will be called when load errors.
+
+
+ Begin loading from url and call onLoad with the parsed response content. +
+ +

[method:Object parsePDB]( [page:String text] )

+
+ [page:String text] — The textual pdb structure to parse. +
+
+ Parse a pdb text and return a JSON structure.
+
+ +

[method:null createModel]( [page:Object json], [page:Function callback] )

+
+ [page:Object json] — The (JSON) pdb structure to parse.
+ [page:Function callback] — Will be called when parse completes, with three arguments: [page:Geometry geometryAtoms], [page:Geometry geometryBonds] and the original [page:Object json].
+
+
+ Parse a (JSON) pdb structure and return two [page:Geometry]: one for atoms, one for bonds.
+
+ +

Example

+ + + // instantiate a loader + var loader = new THREE.PDBLoader(); + + // load a PDB resource + loader.load( + // resource URL + 'models/molecules/caffeine.pdb', + // Function when resource is loaded + function ( geometryAtoms, geometryBonds, json ) { + console.log( 'This molecule has ' + json.atoms.length + ' atoms' ); + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when download errors + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + + + [example:webgl_loader_pdb] + + +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/PDBLoader.js examples/js/loaders/PDBLoader.js] + + diff --git a/docs/api/loaders/SVGLoader.html b/docs/api/loaders/SVGLoader.html new file mode 100644 index 0000000000000000000000000000000000000000..1b2c60ba5492404d0e939b2f3adfbdd40adbda80 --- /dev/null +++ b/docs/api/loaders/SVGLoader.html @@ -0,0 +1,47 @@ + + + + + + + + + + +

[name]

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

Constructor

+ +

[name]( [page:LoadingManager manager] )

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

Properties

+ + +

Methods

+ +

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

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

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/SVGLoader.js examples/js/loaders/SVGLoader.js] + + diff --git a/docs/api/loaders/SceneLoader.html b/docs/api/loaders/SceneLoader.html new file mode 100644 index 0000000000000000000000000000000000000000..b7a169a9cdeecaee676aee940e6f2322ebc5a741 --- /dev/null +++ b/docs/api/loaders/SceneLoader.html @@ -0,0 +1,114 @@ + + + + + + + + + + +

[name]

+ +
A loader for loading a [page:Scene] from a JSON resource.
+ + +

Constructor

+ +

[name]( [page:LoadingManager manager] )

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

Properties

+ + +

Methods

+ +

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

+
+ [page:String url] — required
+ [page:Function onLoad] — Will be called when load completes. The argument will be an [page:Object] containing the loaded components.
+ [page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
+ [page:Function onError] — Will be called when load errors.
+
+
+ Begin loading from url and call onLoad with the parsed scene. +
+ +

[method:Object parse]( [page:Object json], [page:Function callbackFinished], [page:String url] )

+
+ [page:Object json] — The JSON structure to parse.
+ [page:Function callbackFinished] — Will be called when parse completes.
+ [page:String url] — Will be used as base for assets' relative URLs.
+
+
+ Parse a JSON scene description and return a new [page:Object] with fully instantiated Three.js objects. +
+ +

[method:null setCrossOrigin]( [page:String value] )

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

[method:null addGeometryHandler]( [page:String typeID], [page:Function loaderClass] )

+
+ [page:String typeID] — The type to handle.
+ [page:Function loaderClass] — The handler class.
+
+
+ Add an handler for a specific geometry type. +
+ +

[method:null addHierarchyHandler]( [page:String typeID], [page:Function loaderClass] )

+
+ [page:String typeID] — The type to handle.
+ [page:Function loaderClass] — The handler class.
+
+
+ Add an handler for a specific object type. +
+ + +

Example

+ + + // instantiate a loader + var loader = new THREE.SceneLoader(); + + // Handle STL geometries + loader.addGeometryHandler( "stl", THREE.STLLoader ); + + // Handle OBJ objects + loader.addHierarchyHandler( "obj", THREE.OBJLoader ); + + // load a JSON resource + loader.load( + // resource URL + 'scenes/test_scene.js', + // Function when resource is loaded + function ( result ) { + scene.add( result.scene ); + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when download errors + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + + + [example:webgl_loader_scene] + + +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/SceneLoader.js examples/js/loaders/SceneLoader.js] + + diff --git a/docs/api/loaders/TGALoader.html b/docs/api/loaders/TGALoader.html new file mode 100644 index 0000000000000000000000000000000000000000..eb8dcf445c07ab3c9b3cdc5ed4c03fc8a60edcf3 --- /dev/null +++ b/docs/api/loaders/TGALoader.html @@ -0,0 +1,77 @@ + + + + + + + + + +

[name]

+ +
Class for loading a .tga [page:DataTexture texture].
+ + +

Constructor

+ +

[name]( [page:LoadingManager manager] )

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

Methods

+ +

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

+
+ [page:String url] — required
+ [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:DataTexture].
+ [page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
+ [page:Function onError] — Will be called when load errors.
+
+
+ Begin loading from url and pass the loaded [page:DataTexture texture] to onLoad. The [page:DataTexture texture] is also directly returned for immediate use (but may not be fully loaded). +
+ + +

Example

+ + + // instantiate a loader + var loader = new THREE.TGALoader(); + + // load a resource + var texture = loader.load( + // resource URL + 'textures/crate_grey8.tga' + // Function when resource is loaded + function ( texture ) { + console.log( 'Texture is loaded' ); + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when download errors + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + + var material = new THREE.MeshPhongMaterial( { + color: 0xffffff, + map: texture + } ); + + + [example:webgl_materials_texture_tga] + + +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/TGALoader.js examples/js/loaders/TGALoader.js] + + diff --git a/docs/api/loaders/TextureLoader.html b/docs/api/loaders/TextureLoader.html index 2640788be8c4ed4f791e67c89c2096f9972748da..37fc9db75bb291f6e426a4ff68fa0bb7c6bbeb99 100644 --- a/docs/api/loaders/TextureLoader.html +++ b/docs/api/loaders/TextureLoader.html @@ -10,86 +10,73 @@

[name]

Class for loading a [page:Texture texture].
-
Unlike other loaders, this one emits events instead of using predefined callbacks. So if you're interested in getting notified when things happen, you need to add listeners to the object.
-

Constructor

- - -

[name]()

-
- todo -
+

Constructor

-

Events

- -

load

-
- Dispatched when the texture has completed loading -
+

[name]( [page:LoadingManager manager] )

- content — loaded texture object -
- -

error

-
- Dispatched when the texture can't be loaded + [page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
- message — error message + Creates a new [name].
- + +

Properties

-

[property:todo crossOrigin]

+

[property:String crossOrigin]

default — *null*.
If set, assigns the *crossOrigin* attribute of the image to the value of *crossOrigin*, prior to starting the load.
- -

Methods

-

[method:todo load]( [page:String url] )

-
- url — required -
- -
Begin loading from url
-

[method:todo dispatchEvent]([page:todo event])

-
- event -- todo -
-
- todo -
+

Methods

-

[method:todo hasEventListener]([page:todo type], [page:todo listener])

+

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

- type -- todo
- listener -- todo + [page:String url] — required
+ [page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.
+ [page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
+ [page:Function onError] — Will be called when load errors.
- todo + Begin loading from url and pass the loaded [page:Texture texture] to onLoad.
-

[method:todo removeEventListener]([page:todo type], [page:todo listener])

-
- type -- todo
- listener -- todo -
-
- todo -
-

[method:todo addEventListener]([page:todo type], [page:todo listener])

-
- type -- todo
- listener -- todo -
-
- todo -
+ +

Example

+ + + // instantiate a loader + var loader = new THREE.TextureLoader(); + + // load a resource + loader.load( + // resource URL + 'textures/land_ocean_ice_cloud_2048.jpg', + // Function when resource is loaded + function ( texture ) { + // do something with the texture + var material = new THREE.MeshBasicMaterial( { + map: texture + } ); + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when download errors + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + + + [example:canvas_geometry_earth] +

Source

diff --git a/docs/api/loaders/XHRLoader.html b/docs/api/loaders/XHRLoader.html index 9d8440d511e3d5b4941ada170562729bc43f4888..90014b786c83889a7187b855a71beec1b591f5e2 100644 --- a/docs/api/loaders/XHRLoader.html +++ b/docs/api/loaders/XHRLoader.html @@ -7,38 +7,70 @@ -

[name]

-
todo
+

[name]

-

Example

+
A low level class for loading resources with XmlHttpRequest, used internaly by most loaders.
- todo

Constructor

- -

todo

-
+

[name]( [page:LoadingManager manager] )

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

Properties

-

todo

+

[property:Cache cache]

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

[property:String crossOrigin]

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

[property:String responseType]

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

Methods

- -

todo

-
todo
+

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

- todo + [page:String url] — required
+ [page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.
+ [page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
+ [page:Function onError] — Will be called when load errors.
- +
+ Begin loading from url and return the [page:String text] response that will contain the data. +
+ +

[method:null setCrossOrigin]( [page:String value] )

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

[method:null setResponseType]( [page:String value] )

+
+ [page:String value] — the empty string (default), "arraybuffer", "blob", "document", "json", or "text". +
+ + +

Example

+ + [example:webgl_morphtargets_human] + +

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] diff --git a/docs/api/loaders/glTFLoader.html b/docs/api/loaders/glTFLoader.html new file mode 100644 index 0000000000000000000000000000000000000000..a556511361a9dd61665b499e910a4550df22e421 --- /dev/null +++ b/docs/api/loaders/glTFLoader.html @@ -0,0 +1,73 @@ + + + + + + + + + + [page:Loader] → +

[name]

+ +
+ A loader for loading a .gltf resource in JSON format. +

+ The glTF file format is a JSON file format to enable rapid delivery and loading of 3D content. +
+ + +

Constructor

+ +

[name]( )

+
+ Creates a new [name]. +
+ +

Properties

+ + +

Methods

+ +

[method:Object3D load]( [page:String url], [page:Function callback] )

+
+ [page:String url] — required
+ [page:Function callback] — Will be called when load completes. The argument will be an [page:Object] containing the loaded .[page:Object3D scene], .[page:Array cameras] and .[page:Array animations].
+
+
+ Begin loading from url and call the callback function with the parsed response content. +
+ + +

Notes

+ +
+ This class is often used with [page:glTFAnimator THREE.glTFAnimator] to animate parsed animations. +
+ + +

Example

+ + + // instantiate a loader + var loader = new THREE.glTFLoader(); + + // load a glTF resource + loader.load( + // resource URL + 'models/gltf/duck/duck.json', + // Function when resource is loaded + function ( object ) { + scene.add( object.scene ); + } + ); + + + [example:webgl_loader_gltf] + + +

Source

+ + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/gltf/glTFLoader.js examples/js/loaders/gltf/glTFLoader.js] + + diff --git a/docs/api/materials/ShaderMaterial.html b/docs/api/materials/ShaderMaterial.html index f0de7af79d8cf32917f0a4d93863243d8e172a32..85e8b802952ff1ff28d3ee5c8b1ad6273232b147 100644 --- a/docs/api/materials/ShaderMaterial.html +++ b/docs/api/materials/ShaderMaterial.html @@ -11,13 +11,13 @@

[name]

-
Material rendered with custom shaders. A shader is a small program written in [link:https://www.opengl.org/documentation/glsl/ GLSL] to run on the GPU. You may want to use a custom shader if you need to: +
Material rendered with custom shaders. A shader is a small program written in [link:https://www.opengl.org/documentation/glsl/ GLSL] to run on the GPU. You may want to use a custom shader if you need to: - Note that a ShaderMaterial will only be rendered properly by [page:WebGLRenderer], since the GLSL code in the vertexShader and fragmentShader properties must be compiled and run on the GPU using WebGL. + Note that a ShaderMaterial will only be rendered properly by [page:WebGLRenderer], since the GLSL code in the vertexShader and fragmentShader properties must be compiled and run on the GPU using WebGL.

Example

@@ -39,7 +39,7 @@

Vertex shaders and fragment shaders

-

You can specify two different types of shaders for each material: +

You can specify two different types of shaders for each material: