Rael OBJ
A simple OBJ file loader and renderer for the terminal, designed to be used with the rael canvas.
Description
This library provides the core functionality to load a Wavefront .obj model and render it to a list of pixels. These pixels can then be drawn onto a rael::Canvas for display in the terminal.
It supports basic 3D transformations (position, rotation, scale), lighting (ambient and point lights), and texture mapping.
Installation
Add rael_obj to your project's Cargo.toml:
Important: Model Requirements
Your 3D models MUST be triangulated.
This renderer is designed to work with triangular faces only. Models that contain quadrilaterals ("quads") or other polygons with more than three vertices (n-gons) will likely not load or render correctly.
How to Triangulate a Model
You can easily triangulate a model using 3D modeling software like Blender:
- Import your model into Blender.
- Select the object you want to triangulate.
- Switch to Edit Mode (press
Tab). - Select all faces (press
A). - Go to
Face > Triangulate Faces(or use the shortcutCtrl+T). - Export the model as an
.objfile.
Example Usage
Here is a simple example of how to load a model and render it to the console.
use *;
use ;
use File;
use ;
License
This project is not yet licensed.