Git Product home page Git Product logo

elm-gltf's Introduction

Elm GLTF

UNFINISHED! Working on it took very long so I stopped. I'm putting it here so others can take a look at it and potentially fork.

A package for loading and working with 3D models in the GLTF format.

Link to GLTF cheat sheet here.

Run the example

npm install
cd examples
npx elm reactor # compile elm code and spin up a dev server

Features

The glTF spec is quite large, especially when also considering extensions. The following gives a quick overview of feature that elm-gltf aims to support in the foreseeable future.

Data extraction

  • Extracting scenes
  • Extracting nodes
  • Extracting buffers
  • Extracting buffer views
  • Extracting accessors
  • Extracting meshes
  • Extracting textures
  • Extracting texture properties
  • Extracting TRS properties (separate rotation, scale and translation)
  • Extracting meshes with different vertex attributes (right now only position, normal, texCoords)
  • Extracting different materials (PBR, Lambertian, etc)
  • Extracting different mesh types (lines, etc)
  • Extracting orthographic and infinite perspective projection

Formats (Where are the assets?)

  • Embedded glTF(all assets like buffers and images are embedded as base64, single file)
  • Hyperlinked glTF(assets are referenced via URL, multiple files)
  • Binary GLB (everything is bundled into a single binary container file)
  • possibly extensions like DRACO

Current Results

Idea: Create 3 levels

  1. Low-Level: Raw GLTF (normalized, looks like GLTF, Buffers unparsed)
  2. Mid-Level: Tree of things(denormalized, buffers parsed)
  3. High-Level: Just a list of Drawables, and a list of cameras.

Things that can get expensive when done a lot:

  • parsing buffers
  • resolving relationsships:
    • accessors
    • nodes -> meshes
    • material -> textures

Scene could be just something simple to draw. If something like modifying the scene data is needed, there could be an integration with elm-3d-scene for that.

2020-01-21 Using a Camera contained in the glTF

Third Result

2020-01-17 Showing some (hardcoded) texture

Second Result

2020-01-12 Displaying some geometry

First Result

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.