File tree 1 file changed +7
-5
lines changed
packages/model-viewer/src/features
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -434,27 +434,29 @@ configuration or device capabilities');
434
434
435
435
const usdzOptions = {
436
436
ar : {
437
- anchoring : { type : " plane" } ,
437
+ anchoring : { type : ' plane' } ,
438
438
planeAnchoring : {
439
- alignment : this . arPlacement === " wall" ? " vertical" : " horizontal" ,
439
+ alignment : this . arPlacement === ' wall' ? ' vertical' : ' horizontal' ,
440
440
} ,
441
441
} ,
442
442
} ;
443
443
444
- if ( usdzOptions . ar . planeAnchoring . alignment === "vertical" ) {
444
+ // necessary because quicklook internally rotates model when placing vertical.
445
+ // See https://github.com/google/model-viewer/issues/3989
446
+ if ( usdzOptions . ar . planeAnchoring . alignment === 'vertical' ) {
445
447
model . rotateX ( ( - 90 * Math . PI ) / 180 ) ;
446
448
model . updateMatrixWorld ( ) ;
447
449
}
448
450
449
451
const exporter = new USDZExporter ( ) as any ;
450
452
const arraybuffer = await exporter . parse ( model , usdzOptions ) ;
451
453
const blob = new Blob ( [ arraybuffer ] , {
452
- type : " model/vnd.usdz+zip" ,
454
+ type : ' model/vnd.usdz+zip' ,
453
455
} ) ;
454
456
455
457
const url = URL . createObjectURL ( blob ) ;
456
458
457
- if ( usdzOptions . ar . planeAnchoring . alignment === " vertical" ) {
459
+ if ( usdzOptions . ar . planeAnchoring . alignment === ' vertical' ) {
458
460
model . rotateX ( ( 90 * Math . PI ) / 180 ) ;
459
461
model . updateMatrixWorld ( ) ;
460
462
}
You can’t perform that action at this time.
0 commit comments