Atlaslog
Atlaslog / Field Notes / three.js rendering
Field note · three.js rendering

Imported glTF is thumbnail-sized or swallows the camera

Quick answer

Two glTF exports from different tools arrive at wildly different scales because the exporter ignored the metre unit, so one building is 1.87 m tall and another 187000 units. A parent scale that is already non-1 multiplies the error.

Last verified 2026-11-03 · Multiple versions · Cite this page
Applies to: three.js
Symptom
Checklist
  1. Read the bounding box and compare it with the designed real-world size to get the ratio.
  2. Print gltf.scene.scale to check whether a parent transform already scales the model.
  3. Check camera near/far against the model extent.
  4. Frame the model with its bounding sphere before judging whether the size is wrong.
Fix

Wrap the scene in a Group and apply a fixed unitScale (0.01 for centimetres, 0.001 for millimetres), or normalize with fitToHeight using Box3 and setScalar, then reposition the camera from the bounding sphere radius.

Code
var box = new THREE.Box3().setFromObject(gltf.scene);
var size = box.getSize(new THREE.Vector3());
console.log('包围盒尺寸', size);
console.log('根节点缩放', gltf.scene.scale.toArray());
Watch out
All 120 field notesChinese originalRunnable examples
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Cite this page

Atlaslog (2026). Imported glTF is thumbnail-sized or swallows the camera. https://www.jingweizhi.com/en/cookbook/three-gltf-scale.html (accessed 2026-11-03).