| Crates.io | rtw-tui |
| lib.rs | rtw-tui |
| version | 0.1.3 |
| created_at | 2024-12-31 21:38:05.568553+00 |
| updated_at | 2025-01-31 04:57:35.393593+00 |
| description | A TUI using my raytracing library rtwlib |
| homepage | |
| repository | https://github.com/jamdotjar/rtweekend-tui |
| max_upload_size | |
| id | 1500406 |
| size | 142,421 |
This is a terminal user interface (TUI) for my raytracer, that allows you to create, preview, and render simple scenes, all in your terminal! This is based on my library, rtwlib, and is a pseudo-demo for that.
To use rtw.tui, you need to have Rust installed on your system. You can install Rust by following the instructions on the official website.
There are two ways to install rtw.tui, crates.io or building from source.
cargo install rtw-tui
# Clone the repository
git clone https://github.com/jamdotjar/rtweekend-tui.git
# Change to the project directory
cd rtweekend-tui
# Install dependencies
cargo build
# do something with the binrary ig, or just
cargo run
How to use your project. to open the TUI run the following command
rtwtui
This will open the main page, were you can create objects, materials, and render your scene. For each page, I will list the keybindings and what they do.
IMPORTANT: If you try to submit anything (render, material, object) with invalid inputs, nothing will hapen. You will have to fix the inputs before you can submit ( or cancel with
Esc) ALSO IMPORTANT: If your renders take an abnormally long time and result in a black screen, your camera is probably inside an object. This can ususally be fixed by just moving the camera back a bit more Main Page
↑/↓ - Scroll object listn - Create a new objectm - Create a new materialr - Render the sceneq - QuitObject Editor
Tab/Shift+Tab - Change inputs←/→ - Change inputsType - Input values↑/↓ - Choose MaterialEnter - SaveEsc - CancelMaterial Editor
Tab/Shift+Tab - Change inputs←/→ - Change inputsType - Input color↑/↓ - Cycle through material typesEnter - SaveEsc - CancelRender Settings
Tab/Shift+Tab - Change inputs←/→ - Change inputsType - Input valuesEnter - Render scene (this might take a bit)Esc - CloseHere's a a sphere!
here are the settings for this scene.
Sphere 1: radius 0.5, (1, 0, 0)
Sphere 2: radius 100.0, (1, -100.5, 0)
Camera: (-1, 0, 0), lookat(1, 0, 0), fov: 45
Here's a snowman I made with this:
I challenge you to try to make a snowman
this app creates portable pixelmap files (.ppm). These are not widely used, and not ideal for sharing due to their lack of compression. I'd suggest converting them to png or jpg if you want to store them longterm, as otherwise they can be space hogs. Here is a list of programs that could be used to view/convert PPM files:
- GIMP (Mac/Windows/Linux) might be a bit overkill
- Preview (Mac - builtin)
- ImageMagick (Mac/Windows/Linux) conversion only
- IrfanView (Windows)
- this website
This list isnt exhaustive, so check if your normal image viewer can be used first.
This project is licensed under the GPL-3.0 License.