sondro / assetkit Goto Github PK
View Code? Open in Web Editor NEWThis project forked from recp/assetkit
π¨ Modern 2D/3D - Importer β’ Exporter β’ Util - Library, also called (AssetIO)
License: Apache License 2.0
This project forked from recp/assetkit
π¨ Modern 2D/3D - Importer β’ Exporter β’ Util - Library, also called (AssetIO)
License: Apache License 2.0
<p align="center"> <img alt="" src="assetkit.png" width="550" /> </p> <br> <p align="center"> <a href="https://travis-ci.org/recp/assetkit"> <img src="https://travis-ci.org/recp/assetkit.svg?branch=master" alt="Build Status"> </a> <a href="https://ci.appveyor.com/project/recp/assetkit"> <img src="https://ci.appveyor.com/api/projects/status/e52s0fr8mnbmsqy4?svg=true" alt="Build Status"> </a> <a href="https://www.codacy.com/app/recp/assetkit?utm_source=github.com&utm_medium=referral&utm_content=recp/assetkit&utm_campaign=Badge_Grade"> <img src="https://api.codacy.com/project/badge/Grade/6edde2ba446148759437eb0148c799b6" alt="Codacy Badge"/> </a> <a href="https://coveralls.io/github/recp/assetkit?branch=master"> <img src="https://coveralls.io/repos/github/recp/assetkit/badge.svg?branch=master" alt="Coverage Status"/> </a> <img src="https://img.shields.io/badge/glTF-2%2E0-green.svg?style=flat" alt="glTF Badge"> <br /><br /> <a href="https://patreon.com/recp"> <img src="https://img.shields.io/badge/Patreon-Become a patron-orange.svg" alt="Patreon: Become a patron"> </a> </p> <br> <p align="center"> 3D asset importer, exporter library. This library also includes common 3D utils funcs. It is written with C99 but C++ wrappers or other language bindings can be written in the future. This library will full support COLLADA specs and glTF specs, plus other 3D formats e.g .obj, .stl maybe supported by sub-libraries e.g. assetkit-stl, assetkit-fbx. There is also an optional renderer library called [libgk](https://github.com/recp/libgk) for render AssetKit contents. You can see how to load AssetKit to libgk in [assetkit-gl](https://github.com/recp/assetkit-gl) lib/repo. I've also created a basic program (included a screenshot of render result and dae) to show full steps: [simple-collada-viewer](http://github.com/recp/simple-collada-viewer) (todo: outdated.) </p> ## Supported Formats * [x] COLLADA 1.4 and COLLADA 1.4.1 * [x] COLLADA 1.5 * [x] glTF 2.0 (.gltf, .glb, ...) * [x] Wavefront Obj (.obj + .mtl) * [x] STL (ASCII + Binary) * [x] Ply (ASCII + Binary) (working on this) * [ ] USD and friends (License?) * [ ] Alembic (License?) * [ ] Draco * [x] in progress for next... ## Features - Single interface for glTF 2.0 (with extensions), COLLADA 1.4/1.4.1/1.5, Wavefront Obj and others... - Very very small and very fast library - Javascript-like API to get URL or ID `obj = ak_getObjectById(doc, objectId)`... - Options to Generate Mesh Normals *(Default: enabled)* - Option to Triangulate Polygons *(Default: enabled)* - Option to change Coordinate System *(Default: enabled)* - Option to calculate Bounding Boxes *(Default: enabled)* - Unique and Flexible Coordinate System - Support multiple coordinate system - Can convert any coordinate system to another with adding transform or with changing transform, vertex data... - Unique and Flexible Memory Management System - Hierarchical unique memory management - When a node is freed then all sub memories will be freed - COLLADA's **sid** and **ID** values are mapped to memory nodes itself to reduce memory size and make it easy to manage things. - Allow attach ID, sid or user data to a memory node - Will be optimized to be fastest, smallest and most flexible, extendible Asset loader. - [ ] Documentation - [ ] Cmake support - [ ] Tests <table> <tr> <td width="50%"> <img src="https://www.khronos.org/assets/images/api_logos/gltf.svg" style="max-height: 128px"> </td> <td width="50%"> <img src="https://www.khronos.org/assets/images/api_logos/collada.svg"> </td> </tr> <tr> <td valign="top"> -β Single Interface for glTF and COLLADA -β glTF 2.0 -β Options to Generate Mesh Normals -β Acessors, Buffers / BufferViews -β Geometries (Triangles, Polygons, Lines) -β Nodes -β Scenes -β Cameras -β Materials -β Images -β Samplers -β Textures -β PBR Materials -β Metallic Roughness -β Specular Glossiness Extension -β Other textures -β Occlusion map -β Emissive map -β Normal Map - [ ] other textures? -β alphaMode -β alphaCutoff -β doubleSided -β Skin -β Morph -β Animations - Extensions -β KHR_materials_pbrSpecularGlossiness - [ ] Lights (TODO) - [ ] Common materials (TODO) -β glTF-Separate -β glTF-Binary -β glTF-Embedded - [ ] Load glTF-Draco (TODO) </td> <td valign="top"> -β Single Interface for glTF and COLLADA -β COLLADA 1.4 / 1.4.1 -β COLLADA 1.5 -β Object-based Asset support - Resolving Asset support for an element -β Fix / Convert UP axis to any other -β ID resolving -β SID resolving -β Bugfix some DAE files -β Convert angles to Radians -β Convert Multi-Index indices to Single-Index indices by keeping primitive indices -β Options to Generate Mesh Normals -β Option to Triangulate Polygons -β Libraries support -β Geometries -β Meshes (Triangles, Polygons, Lines) -β Brep - Curves, Nurbs, Solids... -β Nodes -β Instances (instance Geometry, Light, Camera...) -β Simplified Controller mechanism into **node->morpher** and **node->skinner** -β Fix camera node transform -β **bind_material** and bind vertex input support to bind material dynamically -β Scenes - Active Scene - Visual Scenes -β Cameras -β Lights -β Materials -β Images -β Samplers -β Textures -β Common Profile -β Phong, Blinn, Lambert and Constant -β οΈ Other profiles were supported, but currently they are removed. But multi profile is still supported. We can support other profiles in the future. -β Transparency (A_ONE, RGB_ONE, A_ZERO, RGB_ZERO) -β Skin -β Morph -β Animations -β Extra -β Load external DAE files and cache them - [ ] Parse MathML formulas - [ ] Physics - [ ] Kinematics - [ ] ZAE - [ ] More to work on... </td> </tr> </table> ## Build ### CMake (All platforms) ```bash $ mkdir build $ cd build $ cmake .. # [Optional] -DAK_SHARED=ON $ make $ sudo make install # [Optional] ``` ##### Cmake options with Defaults: ```CMake option(AK_SHARED "Shared build" ON) option(AK_STATIC "Static build" OFF) option(AK_USE_TEST "Enable Tests" OFF) #Β for make check - make test ``` #### Use with your CMake project * Example: ```cmake cmake_minimum_required(VERSION 3.8.2) project(<Your Project Name>) add_executable(${PROJECT_NAME} src/main.c) target_link_libraries(${LIBRARY_NAME} PRIVATE assetkit) add_subdirectory(external/assetkit/) # or you can use find_package() to configure assetkit ``` ### Unix (Autotools) Step 1: First you should build dependencies, do this only once: ```bash $ sh ./build-deps.sh ``` Step 2: Build, Test and Install AssetKit ```bash $ sh autogen.sh $ ./configure $ make $ make check $ [sudo] make install ``` Step 3: Change install name if required, after make finished make automaticall runs `sh ./post-build.sh` script. It changes install names. You may want to edit build scripts and `post-build.sh` script if you want to build AssetKit with existing libraries. Default behavior is that AssetKit will look up sub libraries inside `.libs` folder, if you only need to change `.libs` name then change it in `post-build.sh` script file. ### Windows (MSBuild) Windows related build files, project files are located in `win` folder, make sure you are inside `assetkit/win` folder. Code Analysis are enabled to it may take awhile to build `git` and `python` commands should be installed/accessible. ```Powershell $ cd win $ .\build.bat $Β msbuild assetkit.vcxproj /p:Configuration=Release ``` if `msbuild` won't work correctly then try to build with `devenv`: ```Powershell $ devenv assetkit.sln /Build Release ``` ### Trademarks glTF and COLLADA and their logos are trademarks of Khronos Group.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.