https://github.com/taichi-dev/voxel-rt2
Voxel Ray Tracer v2 (supersedes https://github.com/taichi-dev/voxel_editor)
https://github.com/taichi-dev/voxel-rt2
Last synced: 13 days ago
JSON representation
Voxel Ray Tracer v2 (supersedes https://github.com/taichi-dev/voxel_editor)
- Host: GitHub
- URL: https://github.com/taichi-dev/voxel-rt2
- Owner: taichi-dev
- License: apache-2.0
- Created: 2022-08-07T07:57:19.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-03T16:03:32.000Z (about 2 years ago)
- Last Synced: 2025-02-22T17:42:19.303Z (over 1 year ago)
- Language: Python
- Size: 1.29 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> Figure: result of `python3 example6.py`. Please replace the image above (`demo.jpg`) with yours, so that other people can immediately see your results :-)
We invite you to create your voxel artwork, by putting your [Taichi](https://github.com/taichi-dev/taichi) code in `main.py`!
Rules:
+ You can only import two modules: `taichi` (`pip` installation guide below) and `scene.py` (in the repo).
+ The code in `main.py` cannot exceed 99 lines. Each line cannot exceed 120 characters.
The available APIs are:
+ `scene = Scene(voxel_edges, exposure)`
+ `scene.set_voxel(voxel_id, material, color)`
+ `material, color = scene.get_voxel(voxel_id)`
+ `scene.set_floor(height, color)`
+ `scene.set_directional_light(dir, noise, color)`
+ `scene.set_background_color(color)`
+ `scene.set_use_physical_sky(True/False)`
+ `scene.set_use_clouds(True/False)`
Remember to call `scene.finish()` at last.
**Taichi Lang documentation:** https://docs.taichi-lang.org/
**Modifying files other than `main.py` is not allowed.**
## Installation
Make sure your `pip` is up-to-date:
```bash
pip3 install pip --upgrade
```
Assume you have a Python 3 environment, simply run:
```bash
pip3 install -r requirements.txt
```
to install the dependencies of the voxel renderer.
## Quickstart
```sh
python3 example1.py # example2/3/.../7/8.py
```
Mouse and keyboard interface:
+ Drag with your left mouse button to rotate the camera.
+ Press `W/A/S/D/Q/E` to move the camera.
+ Press `P` to save a screenshot.
## More examples
## Show your artwork
Please put your artwork at the beginning of this README file. Replacing the `demo.jpg` file with your creation will do the job.







