|
@@ -6,7 +6,7 @@ import * as fflate from '../libs/fflate.module.js';
|
|
|
|
|
|
class USDZExporter {
|
|
|
|
|
|
- async parse( scene, options = { ar: { anchoring: { type: 'plane' }, planeAnchoring: { alignment: 'vertical' } } } ) {
|
|
|
+ async parse( scene, options = { ar: { anchoring: { type: 'plane' }, planeAnchoring: { alignment: 'horizontal' } } } ) {
|
|
|
|
|
|
const files = {};
|
|
|
const modelFileName = 'model.usda';
|
|
@@ -618,9 +618,9 @@ function buildCamera( camera ) {
|
|
|
matrix4d xformOp:transform = ${ transform }
|
|
|
uniform token[] xformOpOrder = ["xformOp:transform"]
|
|
|
|
|
|
- float2 clippingRange = (${camera.near}, ${camera.far})
|
|
|
- float horizontalAperture = ${( Math.abs( camera.left ) + Math.abs( camera.right ) ) * 10}
|
|
|
- float verticalAperture = ${( Math.abs( camera.top ) + Math.abs( camera.bottom ) ) * 10}
|
|
|
+ float2 clippingRange = (${ camera.near.toPrecision( PRECISION ) }, ${ camera.far.toPrecision( PRECISION ) })
|
|
|
+ float horizontalAperture = ${ ( ( Math.abs( camera.left ) + Math.abs( camera.right ) ) * 10 ).toPrecision( PRECISION ) }
|
|
|
+ float verticalAperture = ${ ( ( Math.abs( camera.top ) + Math.abs( camera.bottom ) ) * 10 ).toPrecision( PRECISION ) }
|
|
|
token projection = "orthographic"
|
|
|
}
|
|
|
|
|
@@ -633,12 +633,12 @@ function buildCamera( camera ) {
|
|
|
matrix4d xformOp:transform = ${ transform }
|
|
|
uniform token[] xformOpOrder = ["xformOp:transform"]
|
|
|
|
|
|
- float2 clippingRange = (${camera.near}, ${camera.far})
|
|
|
- float focalLength = ${camera.getFocalLength()}
|
|
|
- float focusDistance = ${camera.focus}
|
|
|
- float horizontalAperture = ${camera.getFilmWidth()}
|
|
|
+ float2 clippingRange = (${ camera.near.toPrecision( PRECISION ) }, ${ camera.far.toPrecision( PRECISION ) })
|
|
|
+ float focalLength = ${ camera.getFocalLength().toPrecision( PRECISION ) }
|
|
|
+ float focusDistance = ${ camera.focus.toPrecision( PRECISION ) }
|
|
|
+ float horizontalAperture = ${ camera.getFilmWidth().toPrecision( PRECISION ) }
|
|
|
token projection = "perspective"
|
|
|
- float verticalAperture = ${camera.getFilmHeight()}
|
|
|
+ float verticalAperture = ${ camera.getFilmHeight().toPrecision( PRECISION ) }
|
|
|
}
|
|
|
|
|
|
`;
|