Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beiyuouo/voxel-challenge
🎲 Code for Taichi Voxel Challenge 2022
https://github.com/beiyuouo/voxel-challenge
pixel-art python taichi voxel-art
Last synced: 15 days ago
JSON representation
🎲 Code for Taichi Voxel Challenge 2022
- Host: GitHub
- URL: https://github.com/beiyuouo/voxel-challenge
- Owner: beiyuouo
- Created: 2022-04-29T13:50:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-11T09:12:18.000Z (over 2 years ago)
- Last Synced: 2024-10-18T08:16:03.151Z (2 months ago)
- Topics: pixel-art, python, taichi, voxel-art
- Language: Python
- Homepage:
- Size: 3.62 MB
- Stars: 3
- Watchers: 1
- Forks: 20
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-taichi - Voxel Pac-man - Making a Pac-Man with voxels. (Applications / **Voxel Art**)
- awesome-taichi - Voxel Pac-man - Making a Pac-Man with voxels. (**Voxel Art**)
README
Blog for pac man and foreness: [https://blog.bj-yan.top/p/blog-taichi-voxel-challenge-2022/](https://blog.bj-yan.top/p/blog-taichi-voxel-challenge-2022/)
Blog for pvz: [https://blog.bj-yan.top/p/blog-taichi-voxel-challenge-2022-pvz/](https://blog.bj-yan.top/p/blog-taichi-voxel-challenge-2022-pvz/)
## Voxel Pac-man in `pac-man.py`
## Voxel Foretress in `fortress.py`
## Voxel PVZ in `pvz.py`
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)`Remember to call `scene.finish()` at last.
**Taichi lang documentation:** https://docs.taichi.graphics/
**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.