|
@@ -57,9 +57,14 @@
|
|
|
|
|
|
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
|
import { USDZExporter } from 'three/addons/exporters/USDZExporter.js';
|
|
|
+ import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
|
|
|
|
|
|
let camera, scene, renderer;
|
|
|
|
|
|
+ const params = {
|
|
|
+ exportUSDZ: exportUSDZ
|
|
|
+ };
|
|
|
+
|
|
|
init();
|
|
|
render();
|
|
|
|
|
@@ -113,6 +118,17 @@
|
|
|
|
|
|
window.addEventListener( 'resize', onWindowResize );
|
|
|
|
|
|
+ const isIOS = /iPad|iPhone|iPod/.test( navigator.userAgent );
|
|
|
+
|
|
|
+ if ( isIOS === false ) {
|
|
|
+
|
|
|
+ const gui = new GUI();
|
|
|
+
|
|
|
+ gui.add( params, 'exportUSDZ' ).name( 'Export USDZ' );
|
|
|
+ gui.open();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function createSpotShadowMesh() {
|
|
@@ -154,6 +170,13 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+ function exportUSDZ() {
|
|
|
+
|
|
|
+ const link = document.getElementById( 'link' );
|
|
|
+ link.click();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//
|
|
|
|
|
|
function render() {
|