Skip to content

aantenberg/ascii-render

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASCII 3D Renderer

This is a simple ASCII 3D renderer that can create scenes with a single point light. Objects can be added to the scene, and lambertian shading is used to render the scene in the terminal.

Basic Rendering

For example, the following is a simple render generated of a scene with a sphere and a point light: With console in dark mode:

                  ! * ! ; , .                                   
              @ @ @ @ @ @ * ; . .                               
          0 @ @ @ @ @ @ @ @ * : . . .                           
        0 @ @ @ @ @ @ @ @ @ @ < , . . .                         
        @ @ @ @ @ @ @ @ @ @ @ ! - . . .                         
      @ @ @ @ @ @ @ @ @ @ @ @ ! : . . . .                       
      @ @ @ @ @ @ @ @ @ @ @ @ ! - . . . .                       
    ! @ @ @ @ @ @ @ @ @ @ @ 0 < - . . . . .                     
    * @ @ @ @ @ @ @ @ @ @ @ * ; , . . . . .                     
    ! @ @ @ @ @ @ @ @ @ @ 0 < - . . . . . .                     
    ; @ @ @ @ @ @ @ @ @ @ ! : , . . . . . .                     
    , * @ @ @ @ @ @ @ 0 ! ; , . . . . . . .                     
    . ; * @ @ @ @ 0 * < : , . . . . . . . .                     
      . : < ! ! ! < ; - , . . . . . . . .                       
      . . , - : - - , . . . . . . . . . .                       
        . . . . . . . . . . . . . . . .                         
        . . . . . . . . . . . . . . . .                         
          . . . . . . . . . . . . . .                           
              . . . . . . . . . .                               
                  . . . . . .                                                                                       

With console in light mode:

                  : - : < 0 @                                   
              . . . . . . - < @ @                               
          , . . . . . . . . - ! @ @ @                           
        , . . . . . . . . . . ; 0 @ @ @                         
        . . . . . . . . . . . : * @ @ @                         
      . . . . . . . . . . . . : ! @ @ @ @                       
      . . . . . . . . . . . . : * @ @ @ @                       
    : . . . . . . . . . . . , ; * @ @ @ @ @                     
    - . . . . . . . . . . . - < 0 @ @ @ @ @                     
    : . . . . . . . . . . , ; * @ @ @ @ @ @                     
    < . . . . . . . . . . : ! 0 @ @ @ @ @ @                     
    0 - . . . . . . . , : < 0 @ @ @ @ @ @ @                     
    @ < - . . . . , - ; ! 0 @ @ @ @ @ @ @ @                     
      @ ! ; : : : ; < * 0 @ @ @ @ @ @ @ @                       
      @ @ 0 * ! * * 0 @ @ @ @ @ @ @ @ @ @                       
        @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @                         
        @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @                         
          @ @ @ @ @ @ @ @ @ @ @ @ @ @                           
              @ @ @ @ @ @ @ @ @ @                               
                  @ @ @ @ @ @  

The renderer is optimized for dark-mode interfaces, with a dark background and white text, but can also be used in light mode through constructor parameters.

Animation

There is also a simple animation engine, that takes in a scene generator, and renders each frame at a desired frame rate. The following are animations created using this engine:

Bouncing Ball

ASCII.Render.Demo.mov

Moving Light

ASCII.Moving.Light.Demo.mov

Feel free to run thes demos yourself using main.py!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages