forked from Shirakumo/cl-gltf
-
Notifications
You must be signed in to change notification settings - Fork 0
glTF 2.0 parser for Common Lisp
Zulu-Inuoe/cl-gltf
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
## How To For the purposes of this tutorial we'll assume the package ``org.shirakumo.fraf.gltf`` has the local nickname ``gltf``. After loading the library, you can parse a glTF or GLB file as follows: :: common lisp (gltf:with-gltf (gltf #p"my-model.gltf") (describe gltf)) :: ``describe`` will emit the full structure of the parsed glTF file. From there you can use the accessors from this package to traverse the structures and convert the information as you need. Of particular importance are the ``accessor``s, which provide a convenient way to parse out the information from the raw underlying byte buffers that they index into. An ``accessor`` is a ``sequence``, so you can simply use ``length`` and ``elt`` to traverse the data. However, note that cl-gltf makes no assumptions about a math library or anything of the sort, so by default it will parse the data out to vectors of the respective element type (usually floats). That buffer will also be shared between ``elt`` calls to avoid excessive consing. Thus, if you are just copying the data out of the buffers to another place, this should be ideal. However, if you would like to customise the way the data is read out, such as to convert it into other structures automatically, you can do so. Either set the ``element-reader`` function on the accessor, or provide a specialised method on the ``construct-element-reader`` function. See the respective docstrings for more info. ## To Do The following are still left to do: - Loading from pointers or byte arrays - Direct support of the ratified extensions - Writing files
About
glTF 2.0 parser for Common Lisp
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Common Lisp 100.0%