Structure
A glTF file describes the scene as JSON: a scene graph of nodes, meshes, materials, cameras and animations. Geometry sits in binary buffers, textures as images [2].
- .gltf: a JSON file plus external buffers and images.
- .glb: everything in one binary file, see GLB.
Conventions worth knowing
- Units: all linear distances are metres [2]. CAD data in millimetres must be converted on export, or the product arrives a thousand times too large.
- Axes: a right-handed coordinate system with +Y up [2]. Many CAD systems use Z as the up axis, which the export must also handle.
- Materials: a physically based model with base colour, metalness and roughness, see PBR [2].
- Animation: movements such as a lid opening can be stored in the model as keyframe animation on nodes [2].
Extensions
Whatever the core does not cover is handled by extensions listed in a public registry [3]: compression of geometry and animation such as Meshopt [4] or Draco, GPU textures with KTX2, and material properties such as clearcoat or transmission for glass. A viewer must support the extensions a file uses.
Why glTF is the norm on the web
The format is designed for fast loading in real-time applications [1], is read by three.js, Babylon.js and model-viewer, and is written by Blender and many CAD tools. For a product viewer or configurator it is almost always the target format.
Every 3D model our example configurators load as a file is a GLB with Meshopt compression, for example the planetary gearhead or the perfume bottle (fictional products). The guide CAD to web 3D explains the conversion from CAD.