This is my programming experiment to turn a command line terminal into a canvas and animate 3D Objects using text characters! Watch the videos below to see it in action. Take a look at how I animated a 3D cube using only text and download my code to experiment with it yourself.
I used two libraries: a matrix helper and a 3D vector helper. They’re not too complicated and I definitely could’ve made my own, but I felt that it would be redundant to do so.
I use “perspective projection” to take in an array of 3D coordinates and “project” them onto a 2d screen.
I use multiple 3D rotation matrices to rotate the points of the cube around the center of the canvas (0,0). When you multiply a vector by a rotation matrix with a specific angle as input, it will rotate the vector by that input angle.
Does your program create all the text dots on the canvas manually or does the library you are using handle that?
The canvas is just a 2D array of simulated “Pixel” objects, each of which contain a color and a “value” that gets displayed on the terminal.