three-gltf-downloader

1.0.3 • Public • Published

three-gltf-downloader

A helper function to download three.js scenes (or Object3D subtrees) to a binary glTF file. It utilizes the THREE.GLTFExporter, and includes the browser code to actually download it to disk.

Installation

$ npm install --save download-three-gltf

Usage

global.THREE = require("three")
const download = require("download-three-gltf")
const scene = new THREE.Scene()
... add some stuff to scene ...
download(scene, {filename: "MyModel.glb"})

Or bind it to a ctrl+s to download later on

window.addEventListener("keydown", (e) => {
  if (e.key === "s" && e.ctrlKey) download(scene);
});

Readme

Keywords

none

Package Sidebar

Install

npm i three-gltf-downloader

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

2.01 kB

Total Files

3

Last publish

Collaborators

  • msfeldstein