Skip to content

Commit 7fb871f

Browse files
committed
handle box with dimension of 0
1 parent d94a2f3 commit 7fb871f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/three/TilesRenderer.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,25 @@ export class TilesRenderer extends TilesRendererBase {
452452
vecY.normalize();
453453
vecZ.normalize();
454454

455+
// handle the case where the box has a dimension of 0 in one axis
456+
if ( scaleX === 0 ) {
457+
458+
vecX.crossVectors( vecY, vecZ );
459+
460+
}
461+
462+
if ( scaleY === 0 ) {
463+
464+
vecY.crossVectors( vecX, vecZ );
465+
466+
}
467+
468+
if ( scaleZ === 0 ) {
469+
470+
vecZ.crossVectors( vecX, vecY );
471+
472+
}
473+
455474
// create the oriented frame that the box exists in
456475
boxTransform.set(
457476
vecX.x, vecY.x, vecZ.x, data[ 0 ],

0 commit comments

Comments
 (0)