Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matboivin/minirt_mesh_converter
Convert .obj files to .rt files to render a triangle mesh effect for ray tracer school project
https://github.com/matboivin/minirt_mesh_converter
42 42born2code minirt
Last synced: about 2 months ago
JSON representation
Convert .obj files to .rt files to render a triangle mesh effect for ray tracer school project
- Host: GitHub
- URL: https://github.com/matboivin/minirt_mesh_converter
- Owner: matboivin
- License: other
- Created: 2020-08-30T15:42:52.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-04-06T14:27:25.000Z (over 1 year ago)
- Last Synced: 2024-08-01T10:21:10.128Z (4 months ago)
- Topics: 42, 42born2code, minirt
- Language: Python
- Homepage: https://matboivin.github.io/minirt_mesh_converter/
- Size: 748 KB
- Stars: 16
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- 42-resources - minirt_mesh_converter
README
# Convert .obj files for 42's miniRT
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
Convert `.obj` files to `.rt` files to render a triangle mesh effect for [miniRT](https://github.com/matboivin/raytracer) project at 42.
## Requirements
* Python 3.9 or greater
* [`poetry`](https://python-poetry.org/)
* Learn more about `.obj` files formatting [here](https://en.wikipedia.org/wiki/Wavefront_.obj_file).## Installation
1. Clone the repository and change it to your working directory.
2. Install the project:
```console
$ poetry install
```## Usage
```console
minirt_converter [-h] filename colorConvert .obj files to .rt files to render a triangle mesh effect for miniRT project at 42.
positional arguments:
filename obj file to convert.
color the color in RGB format (e.g., 255,255,255).optional arguments:
-h, --help show this help message and exitexample usage:
minirt_converter file.obj 255,255,255
```1. Activate the virtual environment:
```console
$ source `poetry env info --path`/bin/activate
```2. Run the project:
```console
$ minirt_converter file.obj 255,255,255
```3. Then, **add Resolution, Ambient Light, cameras and light points** to your [scene](https://github.com/matboivin/raytracer/blob/main/doc/scene_file.md).
### Examples
The `deer.rt`, `dragon.rt` and `wolf3d.rt` scenes can be found [here](https://github.com/matboivin/raytracer/tree/main/scenes).
## Acknowledgements
Many thanks to [MrMoustach](https://github.com/MrMoustach) for contributing by adding a polygon support!
## License
This work is licensed under a
[Creative Commons Attribution-NonCommercial 4.0 International License](http://creativecommons.org/licenses/by-nc/4.0/).