BufferGeometryLoader.html 2.2 KB
Newer Older
1 2 3
<!DOCTYPE html>
<html lang="en">
	<head>
4
		<meta charset="utf-8" />
5 6 7
		<script src="../../list.js"></script>
		<script src="../../page.js"></script>
		<link type="text/css" rel="stylesheet" href="../../page.css" />
8 9 10
	</head>
	<body>
		<h1>[name]</h1>
M
Mr.doob 已提交
11

12
		<div class="desc">A loader for loading an [page:BufferGeometry].</div>
M
Mr.doob 已提交
13 14


15
		<h2>Constructor</h2>
M
Mr.doob 已提交
16

17 18 19 20 21 22 23
		<h3>[name]([page:LoadingManager manager])</h3>
		<div>
		manager -- The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
		</div>
		<div>
		Creates a new [name].
		</div>
M
Mr.doob 已提交
24 25


26
		<h2>Properties</h2>
M
Mr.doob 已提交
27 28


29
		<h2>Methods</h2>
M
Mr.doob 已提交
30

31 32 33 34 35 36 37 38 39 40 41 42
		<h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3>
		<div>
		url — required<br />
		onLoad — Will be called when load completes. The argument will be the loaded [page:BufferGeometry].<br />
		onProgress — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
		onError — Will be called when load errors.<br />
		</div>
		<div>
		Begin loading from url and call onLoad with the parsed response content.
		</div>

		<h3>[method:BufferGeometry parse]([page:Object json])</h3>
C
cjshannon 已提交
43
		<div>
44
		text — The <em>JSON</em> structure to parse.
C
cjshannon 已提交
45
		</div>
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
		<div>
		Parse a <em>JSON</em> structure and returns an [page:BufferGeometry].
		</div>


		<h2>Example</h2>

		<code>
		// instantiate a loader
		var loader = new THREE.BabylonLoader();

		// 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' );
			}
		);
		</code>

78
		<h2>Source</h2>
M
Mr.doob 已提交
79

80 81 82
		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
	</body>
</html>