Skip to content

manyfold3d/mittsu-gltf

Repository files navigation

Mittsu: GLTF

GitHub Actions Workflow Status Maintainability Test Coverage Libraries.io dependency status for latest release

GitHub Release Gem Downloads (for latest version) Dependent repos (via libraries.io)

GLTF support for Mittsu.

Installation

Just install:

bundle add mittsu-gltf

Then require in your code:

require 'mittsu/gltf'

Usage

Currently this gem just includes an exporter. Loading GLTF files might happen at some point.

exporter = Mittsu::GLTFExporter.new
exporter.export(object, "output.gltf")

You can also write binary files for simple single-mesh models:

exporter.export(object, "output.glb", mode: :binary)

Progressive Meshes

The binary GLTF exporter can create "progressive meshes" using the proposed MANYFOLD_mesh_progressive GLTF extension. If you want to create these sort of meshes, you will need to install the mittsu-mesh_analysis gem and create a Mittsu::MeshAnalysis::ProgressiveMesh object, which you can then pass to export in the same way as above.

About

This code was originally written for Manyfold, supported by funding from NLNet and NGI Zero.