Skip to content

xeymy/morph3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

morph3d

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.

Features

  • OBJ Loader: Load and process OBJ files, including vertices, normals, texture coordinates, and transformation matrices.
  • GLTF Loader: Load GLTF & GLB files with support for vertices, indices, texture coordinates, normals, and node matrices.

Upcomming

  • DAE Loader: Load Collada (DAE) files and extract vertices, indices, texture coordinates, and normals.
  • USDZ and STL Support: Soon.

Getting Started

Installation

Add morph3d to your Cargo.toml:

[dependencies]
morph3d = "0.1.1"  # Replace with the latest version

Or use

$ cargo add morph3d

Usage

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...
}

API

Collection

  • vertices: 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.

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have suggestions or improvements.

License

This crate is licensed under the MIT License OR Apache 2.0 License. Feel free to choose one of them.

Acknowledgements

  • Thanks to the Rust community and the maintainers of the dae-parser, tobj, and other libraries used in this project.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages