File tree 2 files changed +5
-2
lines changed
model-viewer/src/features
modelviewer.dev/examples/augmentedreality
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -425,7 +425,7 @@ configuration or device capabilities');
425
425
426
426
await this [ $triggerLoad ] ( ) ;
427
427
428
- const { model, shadow} = this [ $scene ] ;
428
+ const { model, shadow, target } = this [ $scene ] ;
429
429
if ( model == null ) {
430
430
return '' ;
431
431
}
@@ -441,7 +441,10 @@ configuration or device capabilities');
441
441
updateSourceProgress ( 0.2 ) ;
442
442
443
443
const exporter = new USDZExporter ( ) ;
444
+ target . remove ( model ) ;
445
+ model . updateWorldMatrix ( false , true ) ;
444
446
const arraybuffer = await exporter . parse ( model ) ;
447
+ target . add ( model ) ;
445
448
const blob = new Blob ( [ arraybuffer ] , {
446
449
type : 'model/vnd.usdz+zip' ,
447
450
} ) ;
Original file line number Diff line number Diff line change @@ -382,7 +382,7 @@ <h4></h4>
382
382
</ div >
383
383
< example-snippet stamp-to ="customButton " highlight-as ="html ">
384
384
< template >
385
- < model-viewer ar camera-controls touch-action ="pan-y " src ="../../shared-assets/models/Astronaut.glb " alt ="A 3D model of an astronaut ">
385
+ < model-viewer ar camera-controls touch-action ="pan-y " auto-rotate src ="../../shared-assets/models/Astronaut.glb " alt ="A 3D model of an astronaut ">
386
386
< button slot ="ar-button " style ="background-color: white; border-radius: 4px; border: none; position: absolute; top: 16px; right: 16px; ">
387
387
👋 Activate AR
388
388
</ button >
You can’t perform that action at this time.
0 commit comments