Skip to content

Convert .obj files to .rt files to render a triangle mesh effect for ray tracer school project

License

Notifications You must be signed in to change notification settings

matboivin/minirt_mesh_converter

Repository files navigation

Convert .obj files for 42's miniRT

Code style: black pre-commit security: bandit

Convert .obj files to .rt files to render a triangle mesh effect for miniRT project at 42.

deer

Requirements

  • Python 3.9 or greater
  • poetry
  • Learn more about .obj files formatting here.

Installation

  1. Clone the repository and change it to your working directory.

  2. Install the project:

$ poetry install

Usage

minirt_converter [-h] filename color

Convert .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 exit

example usage:
  minirt_converter file.obj 255,255,255
  1. Activate the virtual environment:
$ source `poetry env info --path`/bin/activate
  1. Run the project:
$ minirt_converter file.obj 255,255,255
  1. Then, add Resolution, Ambient Light, cameras and light points to your scene.

Examples

The deer.rt, dragon.rt and wolf3d.rt scenes can be found here.

dragon wolf

Acknowledgements

Many thanks to MrMoustach for contributing by adding a polygon support!

License

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

About

Convert .obj files to .rt files to render a triangle mesh effect for ray tracer school project

Topics

Resources

License

Stars

Watchers

Forks

Languages