Skip to content

borisevichdi/bcr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Business card renderer in python

This code implements the ray casting and creates this animation using python + numba for speed.

I described my journey writing this code in details here:

The idea to make a ray caster in python is inspired by this post - http://fabiensanglard.net/rayTracing_back_of_business_card/

Installation

TL;DR: To install, create a new virtual environment and install the required dependencies by calling:

python -m venv /path/to/new/venv
source /path/to/new/venv/bin/activate
# for Windows: C:\path\to\new\venv\Scripts\activate.bat
pip install -r requirements.txt

The code was written in python3.6.3 (32 bit). It should work in the later versions too (code inspection in PyCharm told me that it has no compatibility issues up to and including 3.10), but I didn't test it.

The installation code only creates a new clean virtual environment and installs the proper versions of three packages: numpy, numba, and opencv-python. You can do it manually (or skip altogether if you already have the right versions of these packages).

Running

python business_card_renderer.py

and wait (number of rendered frame will be printed each time rendering is complete). By default, only 10 frames will be rendered to spare you waiting time. You can change it on top of the script to 120 if you want to see the entire animation.

Note: the window with the animation may not show up on top.

To close the window with the animation press "Esc".

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages