File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/model-viewer/src/features Expand file tree Collapse file tree 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');
434434
435435 const usdzOptions = {
436436 ar : {
437- anchoring : { type : " plane" } ,
437+ anchoring : { type : ' plane' } ,
438438 planeAnchoring : {
439- alignment : this . arPlacement === " wall" ? " vertical" : " horizontal" ,
439+ alignment : this . arPlacement === ' wall' ? ' vertical' : ' horizontal' ,
440440 } ,
441441 } ,
442442 } ;
443443
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' ) {
445447 model . rotateX ( ( - 90 * Math . PI ) / 180 ) ;
446448 model . updateMatrixWorld ( ) ;
447449 }
448450
449451 const exporter = new USDZExporter ( ) as any ;
450452 const arraybuffer = await exporter . parse ( model , usdzOptions ) ;
451453 const blob = new Blob ( [ arraybuffer ] , {
452- type : " model/vnd.usdz+zip" ,
454+ type : ' model/vnd.usdz+zip' ,
453455 } ) ;
454456
455457 const url = URL . createObjectURL ( blob ) ;
456458
457- if ( usdzOptions . ar . planeAnchoring . alignment === " vertical" ) {
459+ if ( usdzOptions . ar . planeAnchoring . alignment === ' vertical' ) {
458460 model . rotateX ( ( 90 * Math . PI ) / 180 ) ;
459461 model . updateMatrixWorld ( ) ;
460462 }
You can’t perform that action at this time.
0 commit comments