Michael Blix 6 месяцев назад
Родитель
Сommit
1d91bc3827
2 измененных файлов с 131 добавлено и 1 удалено
  1. 129 0
      docs/examples/en/exporters/USDZExporter.html
  2. 2 1
      docs/list.json

+ 129 - 0
docs/examples/en/exporters/USDZExporter.html

@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../../" />
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		<h1>[name]</h1>
+
+		<p class="desc">
+		An exporter for `USDZ`.
+		<br /><br />
+		[link:https://graphics.pixar.com/usd/docs/index.html USDZ] (Universal Scene Description ZIP archive) is a
+		[link:https://openusd.org/release/index.html USD-based format] for 3D content optimized for sharing and viewing.
+		USDZ files are ZIP archives containing USD scene data and associated textures. The format supports meshes,
+		materials, textures, and cameras.
+		</p>
+
+		<h2>Import</h2>
+
+		<p>
+			[name] is an add-on, and must be imported explicitly.
+			See [link:#manual/introduction/Installation Installation / Addons].
+		</p>
+
+		<code>
+			import { USDZExporter } from 'three/addons/exporters/USDZExporter.js';
+		</code>
+
+		<h2>Features</h2>
+
+		<p>
+			USDZExporter supports the following features:
+		</p>
+
+		<ul>
+			<li>Meshes with MeshStandardMaterial</li>
+			<li>Textures (diffuse, normal, emissive, roughness, metalness, alpha, ambient occlusion)</li>
+			<li>Clearcoat and clearcoat roughness (from MeshPhysicalMaterial)</li>
+			<li>Cameras (perspective and orthographic)</li>
+			<li>AR anchoring properties for iOS Quick Look</li>
+			<li>Texture compression support with texture utils</li>
+		</ul>
+
+		<h2>Code Example</h2>
+
+		<code>
+		// Instantiate a exporter
+		const exporter = new USDZExporter();
+
+		// Configure export options
+		const options = { maxTextureSize: 2048 };
+
+		try {
+
+			// Parse the input and generate the USDZ output
+			const arraybuffer = await exporter.parseAsync( scene, options );
+			downloadUSDZ( arraybuffer );
+
+		} catch ( error ) {
+
+			console.error( 'Export failed:', error );
+
+		}
+		</code>
+
+		<h2>Examples</h2>
+
+		<p>
+			[example:misc_exporter_usdz]
+		</p>
+
+		<h2>Constructor</h2>
+
+		<h3>[name]()</h3>
+		<p>
+		</p>
+		<p>
+		Creates a new [name].
+		</p>
+
+		<h2>Methods</h2>
+
+		<h3>[method:undefined parse]( [param:Object3D scene], [param:Function onCompleted], [param:Function onError], [param:Object options] )</h3>
+
+		<p>
+		[page:Object3D scene] — Scene or object to export.<br />
+		[page:Function onCompleted] — Will be called when the export completes. The argument will be the generated USDZ ArrayBuffer.<br />
+		[page:Function onError] — Will be called if there are any errors during the USDZ generation.<br />
+		[page:Options options] — Export options<br />
+		<ul>
+			<li>`maxTextureSize` - int. Restricts the image maximum size (both width and height) to the given value. Default is 1024.</li>
+			<li>`includeAnchoringProperties` - bool. Whether to include anchoring properties for AR. Default is true.</li>
+			<li>`quickLookCompatible` - bool. Whether to make the exported USDZ compatible with Apple's QuickLook. Default is false.</li>
+			<li>`ar` - Object. AR-specific options including anchoring type and plane anchoring alignment.</li>
+		</ul>
+		</p>
+		<p>
+		Generates a USDZ ArrayBuffer output from the input Object3D. Note that only MeshStandardMaterial is supported.
+		</p>
+
+		<h3>[method:Promise parseAsync]( [param:Object3D scene], [param:Object options] )</h3>
+
+		<p>
+			Generates a USDZ ArrayBuffer output from the input Object3D.
+		</p>
+		<p>
+			This is just like the [page:.parse]() method, but instead of
+			accepting callbacks it returns a promise that resolves with the
+			ArrayBuffer result, and otherwise accepts the same options.
+		</p>
+
+		<h3>[method:undefined setTextureUtils]( [param:Object utils] )</h3>
+
+		<p>
+			Sets the texture utils for this exporter. Only relevant when compressed textures have to be exported.
+			Depending on whether you use WebGLRenderer or WebGPURenderer, you must inject the corresponding
+			texture utils WebGLTextureUtils or WebGPUTextureUtils.
+		</p>
+
+		<h2>Source</h2>
+
+		<p>
+			[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/USDZExporter.js examples/jsm/exporters/USDZExporter.js]
+		</p>
+	</body>
+</html>

+ 2 - 1
docs/list.json

@@ -377,7 +377,8 @@
 				"GLTFExporter": "examples/en/exporters/GLTFExporter",
 				"OBJExporter": "examples/en/exporters/OBJExporter",
 				"PLYExporter": "examples/en/exporters/PLYExporter",
-				"STLExporter": "examples/en/exporters/STLExporter"
+				"STLExporter": "examples/en/exporters/STLExporter",
+				"USDZExporter": "examples/en/exporters/USDZExporter"
 			},
 
 			"Math": {

粤ICP备19079148号