Skip to content

This is a simple and generic 3D demo, rotating logo or PNG image in text mode.

Notifications You must be signed in to change notification settings

joaocarvalhoopen/Rust_3D_animation_demo_in_Text_Mode

Repository files navigation

Rust 3D animation demo in Text Mode

This is a simple and generic 3D demo, rotating logo or PNG image in text mode.

Description

This program is a 3D demo of a rotating Rust logo or generic PNG image, in text mode (inside a terminal). The program is written in the Rust programming language.

Screen shoots of the video demo

Rust 3D animation image

Rust 3D animation 2 image

Instruction on how to generate the same kind of animation for other logo or image in PNG


1 - Obtain a square or squarish kind of logo.

2 - Edit it só you have two colors, back and white, max out the contrast, and save it as a PNG.    

3 - Change the filename of the PNG at the start of the program code.

4 - Run the program by doing:

cargo run --release  

    (inside the directory of the program.)    

5 - At the end of the program there are two functions two help you test if the reading of the PNG file was correct.

Important note - It uses part of the render engine from Andy Sloane

This code uses parts in the render from my port to Rust, from the donut Javascript made by Andy Sloane 2011.

See the following excellent explanation from Andy Sloane of the mathematics behind it.

Have a donut - obfuscated c donut
https://www.a1k0n.net/2006/09/15/obfuscated-c-donut.html

My port of the render to Rust is in:
joaocarvalhoopen / 3D_Text_donut_demo_in_Rust
https://github.com/joaocarvalhoopen/3D_Text_donut_demo_in_Rust/

License

For my part of the port is MIT Open License but the original render code in Javascript doesn't have a license written, that I could find.

Have fun!

Best regards,
Joao Nuno Carvalho

About

This is a simple and generic 3D demo, rotating logo or PNG image in text mode.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages