| Crates.io | morph3d |
| lib.rs | morph3d |
| version | 0.1.1 |
| created_at | 2024-09-06 12:24:40.013348+00 |
| updated_at | 2024-09-06 12:36:54.254742+00 |
| description | Yet another assimp alternative (obj, gltf & glb is supported). DAE, Stl and Usdz support is comming soon. |
| homepage | |
| repository | https://github.com/v2ny/morph3d |
| max_upload_size | |
| id | 1365863 |
| size | 63,523 |
morph3d is a Rust crate for loading and processing 3D model files in various formats, including OBJ, GLTF, DAE, USDZ, and STL. This crate provides functionality to extract and manipulate mesh data such as vertices, indices, texture coordinates, and normals, and apply transformations to the loaded meshes.
Add morph3d to your Cargo.toml:
[dependencies]
morph3d = "0.1.1" # Replace with the latest version
Or use
$ cargo add morph3d
use morph3d::{Loader, ModelFormat, Collection};
fn main() {
let mut loader = Loader::new("path/to/your/model.obj", ModelFormat::OBJ);
// Load OBJ file
let obj_collection: Vec<Collection> = loader.load();
// Process obj collections...
}
Collectionvertices: Vec<[f32; 3]>: List of vertices in the mesh.indices: Vec<u32>: List of indices for the mesh.texture_coordinates: Vec<[f32; 2]>: List of texture coordinates.normals: Vec<[f32; 3]>: List of normals.matrix: Matrix4<f32>: Transformation matrix applied to the mesh.Contributions are welcome! Please open an issue or submit a pull request if you have suggestions or improvements.
This crate is licensed under the MIT License OR Apache 2.0 License. Feel free to choose one of them.
dae-parser, tobj, and other libraries used in this project.