file in abyss
フォーマット一覧へ戻る

3D

GLB Binary glTF

glTFのJSONとバイナリデータを1ファイルにまとめた形式。先頭4バイトはglTFです。

Extensions .glb
MIME model/gltf-binary, model/gltf+binary

マジックナンバー

ファイルを解析
オフセット 0 GLB magic
67 6C 54 46
glTF

構造

  1. Magic
  2. Version
  3. Length
  4. JSON chunk
  5. BIN chunk

注意点

  • GLBはVRMなどの派生形式でも使われるため、JSONチャンク内のextensionsも確認します。

判定コード例

SIGNATURE = bytes.fromhex("676c5446")
OFFSET = 0

def is_glb(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

Binary glTF は3Dビューア、アセットパイプライン、モデル変換、アバター読み込み、シーン検証などで使われます。コンテナ・拡張子・バイナリチャンク・テクスチャ参照が実装の挙動に影響します。

よくある判定ミス

  • .glb という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • Binary glTF は 67 6C 54 46 のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。

サンプルの活用

11 個のサンプルで、ビューアの読み込み・拡張子判定・ファイルサイズごとの読み込み時間をテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
3D

Box Vertex Colors GLB

Box Vertex Colors GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

01-box-vertex-colors.glb
Type Sample
1.9 KB
SHA-256 9c48227f33b0ba2fbcf23b98ebf60d1c8ae0c6e6c5281e0aa3cc58affee10382
Download
3D

Animated Colors Cube GLB

Animated Colors Cube GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

02-animated-colors-cube.glb
Type Sample
15 KB
SHA-256 995bb9db5bd011b64bc9fc2235c60e5455e2931e509db5e715b4d20afc5ba71e
Download
3D

Animated Morph Cube GLB

Animated Morph Cube GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

03-animated-morph-cube.glb
Type Sample
6.6 KB
SHA-256 214ee56160a50dbf22543a1d66dbf860986e87f0efac3d89feac1359d0e6aeab
Download
3D

Simple Instancing GLB

Simple Instancing GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

04-simple-instancing.glb
Type Sample
7.2 KB
SHA-256 1c9425627481346a8c226118f7000db7cd7f80198e9f54331f8b664d16726f3f
Download
3D

Metal Rough Spheres GLB

Metal Rough Spheres GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

05-metal-rough-spheres.glb
Type Sample
284 KB
SHA-256 5e677f260ec0f366967a6e9545de2f3dab2a160e307b9bcb9d050cd2028f63f8
Download
3D

Glass Vase Flowers GLB

Glass Vase Flowers GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

06-glass-vase-flowers.glb
Type Sample
Large file
1.74 MB
SHA-256 430c9937664cfc74299205dcc388e4269bb688817f3d3866ef35aab71e93b852
Download
3D

Clearcoat Wicker GLB

Clearcoat Wicker GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

07-clearcoat-wicker.glb
Type Sample
Large file
1.24 MB
SHA-256 f162b0cd7f8e6b7cef211eec57762165a78039676b8592ce1f965e2ddb34e843
Download
3D

Avocado GLB

Avocado GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

08-avocado.glb
Type Sample
Large file
7.73 MB
SHA-256 ccc9c3ce56423720b09399c2351537207cd5a65f859f9e6e2f30922762f3abd4
Download
3D

Toy Car GLB

Toy Car GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

09-toy-car.glb
Type Sample
Large file
5.17 MB
SHA-256 01a60862de55cd4b9f3acfab0b0def86451800f9c42467fcd61052c16cb9838c
Download
3D

Water Bottle GLB

Water Bottle GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

10-water-bottle.glb
Type Sample
Large file
8.55 MB
SHA-256 b337e526fd6a162013c2984aeec163f5fbb4f717252724dfc3f3458bd51df94b
Download
3D

Box GLB

Box GLB is a Binary glTF sample based on Khronos glTF Sample Assets. It can be used to test downloads, parsers, previews, and file type detection.

box.glb
Type Sample
1.6 KB
SHA-256 ed52f7192b8311d700ac0ce80644e3852cd01537e4d62241b9acba023da3d54e
Download

よくある質問

Binary glTF のマジックナンバー(ファイルシグネチャ)は?

Binary glTF ファイルはバイトシグネチャ 67 6C 54 46 ("glTF") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

Binary glTF のMIMEタイプは?

Binary glTF のMIMEタイプは model/gltf-binary, model/gltf+binary です。

Binary glTF の拡張子は?

Binary glTF ファイルは .glb 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット