|
@@ -1,90 +1,78 @@
|
|
|
-<!DOCTYPE html>
|
|
|
-<html lang="en">
|
|
|
- <head>
|
|
|
+<!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>
|
|
|
- [page:Loader] →
|
|
|
- <h1>[name]</h1>
|
|
|
-
|
|
|
- <div class="desc">A loader for loading objects in JSON format.</div>
|
|
|
-
|
|
|
-
|
|
|
- <h2>Constructor</h2>
|
|
|
-
|
|
|
- <h3>[name]()</h3>
|
|
|
- <div>
|
|
|
- Creates a new [name].
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h2>Properties</h2>
|
|
|
-
|
|
|
- <h3>[property:boolean withCredentials]</h3>
|
|
|
- <div>
|
|
|
- If true, the ajax request will use cookies.
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h2>Methods</h2>
|
|
|
-
|
|
|
- <h3>[method:null load]( [page:String url], [page:Function callback], [page:String texturePath] )</h3>
|
|
|
- <div>
|
|
|
- [page:String url] — required<br />
|
|
|
- [page:Function callback] — required. Will be called when load completes. The arguments will be the loaded [page:Object3D] and the loaded [page:Array materials].<br />
|
|
|
- [page:String texturePath] — optional. If not specified, textures will be assumed to be in the same folder as the Javascript model file.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:null loadAjaxJSON]([page:JSONLoader context], [page:String url], [page:Function callback], [page:String texturePath], [page:Function callbackProgress])</h3>
|
|
|
- <div>
|
|
|
- [page:JSONLoader context] — The [page:JSONLoader] instance<br />
|
|
|
- [page:String url] — required<br />
|
|
|
- [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.<br />
|
|
|
- [page:String texturePath] — Base path for textures.<br />
|
|
|
- [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.
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Begin loading from url and call <em>callback</em> with the parsed response content.
|
|
|
- </div>
|
|
|
-
|
|
|
- <h3>[method:Object3D parse]( [page:Object json], [page:String texturePath] )</h3>
|
|
|
- <div>
|
|
|
- [page:String json] — JSON object to parse.<br />
|
|
|
- [page:String texturePath] — Base path for textures.
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- Parse a <em>JSON</em> structure and return an [page:Object] containing the parsed .[page:Geometry] and .[page:Array materials].
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
- <h2>Example</h2>
|
|
|
-
|
|
|
- <code>
|
|
|
- // 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 );
|
|
|
- }
|
|
|
- );
|
|
|
- </code>
|
|
|
-
|
|
|
- [example:webgl_loader_json_blender]
|
|
|
-
|
|
|
-
|
|
|
- <h2>Source</h2>
|
|
|
-
|
|
|
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
- </body>
|
|
|
-</html>
|
|
|
+ <base href="../../" />
|
|
|
+ <script src="list.js"></script>
|
|
|
+ <script src="page.js"></script>
|
|
|
+ <link type="text/css" rel="stylesheet" href="page.css" />
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ [page:Loader] →
|
|
|
+ <h1>[name]</h1>
|
|
|
+
|
|
|
+ <div class="desc">A loader for loading objects in JSON format.</div>
|
|
|
+
|
|
|
+
|
|
|
+ <h2>Constructor</h2>
|
|
|
+
|
|
|
+ <h3>[name]()</h3>
|
|
|
+ <div>
|
|
|
+ Creates a new [name].
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <h2>Properties</h2>
|
|
|
+
|
|
|
+ <h3>[property:boolean withCredentials]</h3>
|
|
|
+ <div>
|
|
|
+ If true, the ajax request will use cookies.
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <h2>Methods</h2>
|
|
|
+
|
|
|
+ <h3>[method:null load]( [page:String url], [page:Function callback], [page:String texturePath] )</h3>
|
|
|
+ <div>
|
|
|
+ [page:String url] — required<br />
|
|
|
+ [page:Function callback] — required. Will be called when load completes. The arguments will be the loaded [page:Object3D] and the loaded [page:Array materials].<br />
|
|
|
+ [page:String texturePath] — optional. If not specified, textures will be assumed to be in the same folder as the Javascript model file.
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <h3>[method:Object3D parse]( [page:Object json], [page:String texturePath] )</h3>
|
|
|
+ <div>
|
|
|
+ [page:String json] — JSON object to parse.<br />
|
|
|
+ [page:String texturePath] — Base path for textures.
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ Parse a <em>JSON</em> structure and return an [page:Object] containing the parsed .[page:Geometry] and .[page:Array materials].
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <h2>Example</h2>
|
|
|
+
|
|
|
+ <code>
|
|
|
+ // 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 );
|
|
|
+ }
|
|
|
+ );
|
|
|
+ </code>
|
|
|
+
|
|
|
+ [example:webgl_loader_json_blender]
|
|
|
+
|
|
|
+
|
|
|
+ <h2>Source</h2>
|
|
|
+
|
|
|
+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
|
+ </body>
|
|
|
+</html>
|