GLTF (.gltf, .glb)

Background

    • MIME type: model/gltf+binary, model/gltf+json
    • Graphics Language Transmission Format.
    • 3D graphics format.
    • Commonly used to share 3D scenes and models.
    • Developed in 2015 by the Kronos Group.
    • ASCII or binary format.
    • Provides schemas for standard encoding of 3D scenes and models.

Import & Export

  • Export["file.gltf",expr] exports a 3D object to a binary GLTF file. The expr can be any 3D geometric region that is ConstantRegionQ or a Graphics3D object.
  • The export format can be specified with Export["file",expr,"GLTF"].
  • File formats and file extensions used by the GLTF specification include:
  • "GLTF"ASCII encoded
    "GLB"binary encoded
  • See the following reference pages for full general information:
  • Exportexport to a file
    CloudExportexport to a cloud object
    ExportStringexport to a string
    ExportByteArrayexport to a byte array

Examples

open allclose all

Basic Examples  (1)

Export a 3D model to an ASCII GLTF file:

Print the raw textual contents of the file:

Scope  (6)

Basic Uses  (2)

Export to a binary GLTF file:

ASCII GLTF file:

Graphics  (2)

Export Graphics3D objects:

Graphics from a file:

Regions  (2)

Export special regions:

Formula regions:

Properties & Relations  (3)

Export to a cloud object:

Export to a string:

Export to a byte array: