34 releases

0.15.2 Mar 29, 2020
0.15.0 Jan 18, 2020
0.14.0 Oct 6, 2019
0.13.0 Jul 27, 2019
0.2.1 Nov 17, 2016

#5 in Graphics APIs

Download history 1580/week @ 2020-05-28 1586/week @ 2020-06-04 1418/week @ 2020-06-11 1049/week @ 2020-06-18 1653/week @ 2020-06-25 1309/week @ 2020-07-02 960/week @ 2020-07-09 723/week @ 2020-07-16 503/week @ 2020-07-23 890/week @ 2020-07-30 2194/week @ 2020-08-06 2703/week @ 2020-08-13 4110/week @ 2020-08-20 4499/week @ 2020-08-27 3304/week @ 2020-09-03 2547/week @ 2020-09-10

3,978 downloads per month
Used in 40 crates (17 directly)

MIT/Apache

335KB
7.5K SLoC

gltf

travis crates.io docs.rs


This crate is intended to load glTF 2.0, a file format designed for the efficient transmission of 3D assets.

rustc version 1.32 or above is required.

Reference infographic

infographic

From javagl/gltfOverview.

Usage

See the crate documentation for example usage.

Features

Extras and names

By default, gltf ignores all extras and names included with glTF assets. You can negate this by enabling the extras and names features, respectively.

[dependencies.gltf]
version = "0.15"
features = ["extras", "names"]

glTF extensions

The following glTF extensions are supported by the crate:

  • KHR_lights_punctual
  • KHR_materials_pbrSpecularGlossiness
  • KHR_materials_unlit

To use an extension, list its name in the features section.

[dependencies.gltf]
features = ["KHR_materials_unlit"]

Examples

gltf-display

Demonstrates how the glTF JSON is deserialized.

cargo run --example gltf-display path/to/asset.gltf

gltf-export

Demonstrates how glTF JSON can be built and exported using the gltf-json crate.

cargo run --example gltf-export

gltf-roundtrip

Deserializes and serializes the JSON part of a glTF asset.

cargo run --example gltf-roundtrip path/to/asset.gltf

gltf-tree

Visualises the scene heirarchy of a glTF asset, which is a strict tree of nodes.

cargo run --example gltf-tree path/to/asset.gltf

Dependencies

~1–2.1MB
~47K SLoC