https://github.com/meirbon/l3d
Loader-3D: 3D object loading library for Rust.
https://github.com/meirbon/l3d
3d 3d-graphics 3d-loader gltf rust
Last synced: 2 months ago
JSON representation
Loader-3D: 3D object loading library for Rust.
- Host: GitHub
- URL: https://github.com/meirbon/l3d
- Owner: meirbon
- License: mit
- Created: 2020-12-07T13:19:32.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-03T18:41:25.000Z (almost 5 years ago)
- Last Synced: 2025-09-23T23:59:37.325Z (9 months ago)
- Topics: 3d, 3d-graphics, 3d-loader, gltf, rust
- Language: Rust
- Homepage:
- Size: 701 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/MeirBon/l3d)
# Loader-3d
A simple 3d loader written in Rust.
This project does not attempt to become the fastest loading 3D library, it serves as a simple library to quickly get started with the interesting (fun) stuff.
Currently, the project supports Obj and glTF files but adding more formats should be easy.
## Usage
```rust
use l3d::prelude::*;
// Create an instance
let instance = LoadInstance::new()
// Adds default loaders (gLTF and obj files)
.with_default();
// Load file
match instance.load(LoadOptions {
path: PathBuf::from("path/to/my/file.gltf.obj"),
..Default::default()
}) {
// Single mesh
Mesh(descriptor) => {
// descriptor.vertices: Vec<[f32; 4]>,
// descriptor.normals: Vec<[f32; 3]>,
// descriptor.uvs: Vec<[f32; 2]>,
// descriptor.tangents: Vec<[f32; 4]>,
// descriptor.material_ids: Vec,
// --- Mesh descriptors do not have a material list when they are part of a scene ---
// descriptor.materials: Option,
// descriptor.meshes: Vec,
// descriptor.skeleton: Option,
// descriptor.bounds: AABB,
// descriptor.name: String,
}
// A scene with meshes and a scene graph
Scene(descriptor) => {
// descriptor.materials: MaterialList,
// descriptor.meshes: Vec,
// descriptor.nodes: Vec,
// descriptor.animations: Vec,
}
// Error
None(LoadError),
}
```