项目作者: Gnimuc

项目描述 :
glTF loader and writer for Julia
高级语言: Julia
项目地址: git://github.com/Gnimuc/GLTF.jl.git
创建时间: 2015-10-26T14:00:01Z
项目社区:https://github.com/Gnimuc/GLTF.jl

开源协议:MIT License

下载


GLTF

CI
TagBot
Codecov

glTF 2.0 loader and writer based on JSON3. This package only handles .gltf and not .glb.

Installation

  1. pkg> add GLTF

Usage

glTF file format is just a JSON file + raw binaries. This package defines Julia types that map to the corresponding glTF objects.

  1. julia> using JSON3, GLTF
  2. julia> accessor_str = """{
  3. "bufferView": 0,
  4. "componentType": 5126,
  5. "count": 24,
  6. "type": "VEC3",
  7. "max": [
  8. 0.3,
  9. 0.3,
  10. 0.3
  11. ],
  12. "min": [
  13. -0.3,
  14. -0.3,
  15. -0.3
  16. ],
  17. "name": "Positions Accessor"
  18. }"""
  19. "{\n \"bufferView\": 0,\n \"componentType\": 5126,\n \"count\": 24,\n \"type\": \"VEC3\",\n \"max\": [\n 0.3,\n 0.3,\n 0.3\n ],\n \"min\": [\n -0.3,\n -0.3,\n -0.3\n ],\n \"name\": \"Positions Accessor\"\n}"
  20. julia> accessor = JSON3.read(accessor_str, GLTF.Accessor)
  21. GLTF.Accessor:
  22. bufferView: 0
  23. componentType: 5126
  24. count: 24
  25. type: VEC3
  26. max: Any[0.3, 0.3, 0.3]
  27. min: Any[-0.3, -0.3, -0.3]
  28. name: Positions Accessor

load/save file from/to disk:

  1. load("path/to/xxx.gltf") # -> GLTF.Object
  2. save("path/to/xxx.gltf", x) # where x is of type GLTF.Object