• Stars
    star
    131
  • Rank 275,867 (Top 6 %)
  • Language
    C++
  • Created almost 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

3D Render in ASCII art

ASCII ART

C++ implementation of image to ASCII art conversion.

The main functionality is in ascii_art in ascii_art.h. For general inputs I use stb_image_resize.h to resize the input. Otherwise, the only dependency is the standard library.

There are three executable demos exposing this:

image2ascii

Convert an input image into ASCII art

For example, if you issue:

./image2ascii ../max-schmeling.jpg

You'll see:



                          ______
                     __qMMMMMMMMMMp___
                   _qMMMMMMMMMMMMMMMQQp_
                  _QMMMMMMMMMMQMMMMMMMQMQ_
                 _QMMMMMMMMMMMMMMMMMMMMMMQy
                qMMMMMME``` `""""#WMMMMMMQ#_
               qMMMMMQE@`            `@MMMMp
               qMMMMME@"`             _@MMMp
             _qQMMMME"`__p_____      ___MW^
            _qMD?,3ME"`@@@7_QMM@   qQMMMQ
            @MM   qM@`      7 ``  -"7WE@@
            "QMp  _E@`            "    -@
            _QMM_  Q@_            "`    @
            qMMMMQpj@@         -__;)  `_
            @MMMMMMQp@"         ` @__ _'
             @MMMMMMQ@_`   ,=--,,,_@" j
              `7MMMMQMpjj`    _qp_@-`j@_
                "MMMMpMQpp__`````_pqp@@@`"-,_                         _qMMMMMQp_
                 @MMMQp"7MQp___;_jQF````     `"--,__             _pQqqMMMMMMMMMMp_
                  MMMMM_  `7WWWMW^              __g@@@=--u__      MMMMMMMMMMMMMMMMp
                  _QMMMMMMp__           _,.- -"@@@@"`     `"@@_    MMMMMMMMMMMMMQMMp
                _qMMMMMMMMMMQ_        ```     ``"``          `MQp_ dMMMQQMMMMMQQQMMMp
               _qMMMMMMMMMMMMMp    ,,`        ```             `TMMp_MMMMQQ@QMMMMMMMMQ
            _qQMMMMMMMMMMMMMMMMp-"" `                           "MMMMMMMQ@""@MMMMMMMMp
        __g@@qQMMMMMMMMMMMMMMMMMp                               _QMMMMMMQQp_@QQMMMMMM"
      _q@@@@@MMMMMMMMMQMMMMMMMMMp;.                             "MMMMMMQMMMQMQMMMMMM#
      #@@@@@qMMMMMMMMQQQQqQQMMM#                                 MMMMMMMMMQMQMQMMMMM`
    _qQ@@@_qMMMMMMMMMMMQMMQQQME `                       _`       `9MMMMMMMMMMMMQMMMM
    gQ@@@qMMMMMMMMMMMMMMMMMW7`_p_`                     _p_         qMMQMMMMMQMMMMMMF
   q#M@@qMMMQMMQQMQMMMMMW"   `=Q__                    _jQp         `MMMMQMQMMMQQME"
   qpE@@@MMMMMQMQMMMQQMb       J@@`                  `@MMQ_          7MMQMMMMMWQMM_
   Q#Q@@@@@MMQ@FMQMMQMD        j@@-`                  `"WWMQ_         `MMQ``7T7QMEMp
   QMQQQ@@qMME@j-:`WWE          `@_`                        Mp_        q#M@";"@@@@@Mp
   qMpQQ@_QQQ@__j"` _@          _@@_        ____             9Qp_      q#@@;`"@@@"jMMp
   "M#QE@QMME@@_ - -j@_         `j@@@`      "@@@   ;         `JMQp_    q#@``   _@@@@Q#
    q#Q@qMQQy""`_ ;@qp@``        "@@@@`                      `@QMMp_   qM@````""@Q@@Q#
    qMQQMME@j_-`@"%_qMp___ __;    @"`"`                 ``` __@QMMMQp jqQ@__ ```_@QQQ#
    #QQMMEp@@"-"-`@@#ME@@_@@"`   `;```                  ```""@@MMMMMMp__#p@"`__j@@@QM#
   qMQMMME@_`""-_`j@#MMQ@@@j"`    `;"`                   ```"@QMMMMMMMMpFMQp@j@@Q@@@Q#
   QMMMQM@@-@%""- jqMMQQ@@@@@@`    `_``                   ``"@Q"MMMMMMMMMQpQQ_QW@@@@Q`
  qMMMQQ@p@@j_ "-_@qQMMQ@@@@@@__-  `--`                  ```"@Q_`@MMMMMMMMMQQQMMp@@@
 _QMMMQQQ@@__""%_j@MMMMQQQ@@@@@@_`  "```               ` ``""@Qp  "MMMMMMMMMMMME"`
 qMMMQQQQ@@@_@"__@QQMQQMMQ@@@@@@____";``                 ```"_@g_  `@MMMMMMMMMME`
 QMQQMQQQ@@@@@j@jQQKMMMQQQQQQ@@@@@@@j@___`      ````    ___pqMQQ#    `?MMMMMMME@
 MMMMMMMQ@@@@j@@QQ# qMMQQQMQQQQQ@@@@_@p@@_   _______pQQMQMMMMMEMy        `"7T"`
 "MMMQE@@@@@@@qQQK  qMMQQQQQQQQQQ____QQppQqMMQMMQMMMMMM#QQpQWQQM#_
   MMQp@@@@@@qQW"   "MMMMMMMMMQQMQQQQQMEEMMMMQQQqqQWQ#QMQMMMMQQQQQp
   `MMMQQQ___QF`    qMMMQMMMM#QMpQQQMQM##QMMQQQQMMMMM#QQQpQQMMMMMMQp_
    7MMMMQMMW"       qMQQMQQMMMMMMp#MMQMMMMMQMMQQQMQMMMMQMMMMMMMMMMMMp
      `7WWF"         qMMMQQQQQQQQQQQQQQQQQMMMMMMMMMMMMMMMMQQMMMMMMMMMMp_
                    qMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMQQMMQMMMMMMMMMMMM#_
                   _QMMMMMMMMMMMMMMQMMMMMMMMMMMMMMMMMMMMMMMMMMMMMQMMMMMMp
                   qMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMQQQMMMMMMMMMMMMMMMMMMM_
                   QMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMQQMMMMMM#
                  _QMMMMMMMMMMMMMMMMQMMMMMMMMMMMMMMMMMMMMMMMMMMQMMMMMMMMMM

spy

Visualize a matrix similar to MATLAB's spy command, but as ASCII art. This command constructs the cotangent Laplacian of an input triangle mesh and visualizes this sparse matrix to the terminal:

For example, if you issue:

./spy ../suzanne.obj

You'll see:

',                           _, ,.i .  .                 ~`7^*==,i,_____  .  i .__    `*=<___  .__  j,i.
  ',                             u                              ^"`77"`**~==CkiQ______   "``*~=k,___
    ',                       `7W~~8W2,Q`j?j___" '     __"                                           7=JTQ@j_""   _
      ',                     _         _     ``7"*>~=wci,                            j             _    _   7^%wmi
        ',                     `^*=a___,_u,   ,                                                      "w___, .
          ',                           `^v=L__` ` __   ,"                                               `^=_]"_
            ',                                 `^6AQ_g_                                                      ^k__
              ',                                       `7*=aQ_x                       m_+                        `
                ',           j& *-~                            `7*w,_,- *    ~    _      ^qp"  -    s"-
                  ',                                                  `7*=upp_^ `           ^wx=
                    ',                                   __                   `7^=uQ_^          7wQt
                      ',                                    ``7">~~=<i,,___            `7*=i__
                        ',   ,,___                                           ``7^*~=<i         `^*=i__
                          ',       ```7^~~=ii,____                                                     `^*=.__
 ,     (         ,       ,  '_         .           ``7"^~          _.                               _          `"~
 )  L   _                }    9__  J     -                      _ ?                                 3_<  "
 `  d   [       ^  _     j     nAg .                             ]           _                       5_
    L   (_                    _   3y     _?   _                                                       3_ _/
    -p   \                b   -     9_<`_                                                              \6_
    `K   5_               {  _      /<Rp                                                                \ ^
    ]]  _C[               d        ( `  5gr   " `       "                                                3e `"
    ^j   `?_                      *   ` " B_ y-        g                                                  3_-    -
     (p    ]               y               yM_"   _>                                                       A* _ "
    '!)  ""7p              }       "    -   \ 0_<_,     -                                                   \</  -
    ' [   :"j              3            :     C_BQ.  _                                                       K,
      O    q"p                              _x `  9_ V,                                                       \>y
      _     _j              b                    ___jQ<                                                        q\
     \"p   ) U_             ]              j~ -    ` ~5_y                                                       ^_
_   ;  %  -   V             d           ; ~   /        TR__ _,                        _,,                        7
b             J_     "                                   `Wg_ l                       \_"
j             ;1      b                                  s ?WQ _                       T,_
M             ?__     )                                   "   jp                        \.
 )[             \     j        "y,                           `  Mp      u    _           \  ^  ,     r
 }b              p    "      _*                                   Mp_y                    V/        f
 q)              #     p                                          _JR_          :_>        y     _ "
 ({               p    )                                          ` < 9p    ~ _ p`          p    ^
  d             " 3    [                                         "      8p___                b_C
  d                y   d                                                 -5Q`                "Q
 _Rp              =0             _                               r      .-"`Rg                 @      _
   p              ! p   )                                              ?      AQ                E
 j #              C q   [                                           `_Y`        Bp  y^           y_6
  `#             ?  :p  "                                           ?`          : 9p .            @/
   d   y            J3   p                                                      y*  ?_             y
V             ?y                                         7Pe__                        ',
M__           " _     \                                  "`  L7x__                      ',
 l)              k     _                                          _Mm_                    ',
 `4             ~ \    \                                        >~  ` "^e__                 ',
 _F               C\    _                                        ,    - .<=*q_                ',
 \.L             _- \   \                                            _,-      7^m_              ',
   I   _            j\   _                                                      jw^"<_            ',
 )  L   _       .        \   `?<_                               . ^`                                ',
    y   Gg                _   _  JD<_                            `           `                        ',
    Q) = fb               \  =.    .R[7w_                                                               ',
    'q   "/_                      *`  "  `b&_                                                             ',
    ['L  ")!p              (       `    ,   ^ Te_                                                           ',
      U    v"_              p                < `  P<__                                                        ',
     j"p   - T_             l              L~     `^`~>q_                                                       ',

ascii3d

Ray trace an input 3D triangle mesh or 3D scene as ASCII art.

For example if you issue,

./ascii3d ../suzanne.obj

You'll see:

                              _____mmmmmmmmmm_____                              
                          __p@@@@"""""""""""""""@@@m__                          
                        _g@@@"`___``   ``   ``___`"@@@p_                        
                      _d@@@@_j"`  `%_      _/`  `"@_@@@@@_                      
                     /@@@@j@`       @_    _@       `%@j@@@h                     
                    j@j@"` _;````";_ "_  _@ _;"````;_ `"@@@k                    
          -'___  _ _@` __@"`__, ,_ `- `""` ;" _ ,,__`"%__ `@_ _  ___'-          
        ,  _QQQQp_^#@@"`` j@_-``-_%  `    `  ;_-``"_@@ ```"@@"_qQQQQ__ \        
        @ j    `7QpQ@@_   @@"    j_          _)    `@@   _j@QQp@`    % _        
        ) |``   @@@Qp@@_;_"@@____@@          @@____y@/_;_j@qQE@@   ``j j        
         @ ,``` @@@@QQp@__@_"R@@@`-           `@@@R"_@"_jqQW@@@@ ```, j`        
          "__~__"@@qQMQQp@j_@@""`              `""@@__jqQMMQ@@@"__-"jF          
            `%m___"@WMMMMMQQQpp____          ____jQQQQMMMMMK@"___p="            
                 `77777``7FWMMQQQQQp__ __ __jQQQQQMMWF7```7777`                 
                             7WMQMME__    _pQMMQMW^                             
                                3ME@"@mjjpF"@MMK`                               
                                 @@"        "@@                                 
                                _@@`        `"@_                                
                                (@"          `@]                                
                                #@`          `@@                                
```````````````````````````    _@@`          `"@p    ```````````````````````````
``````````````_________________q@"`  _q__p_  `"@p_________________``````````````
             ````"""""""%%@@@@@q@@___"_``_@____@p@@@@@@%""""""""```             
                         ```````Wp__pppppppp__q#"```````                        
                                ``````77777``````                               

This ray-tracer is interactive

Try hitting the hjklJK keys to interact with the 3D scene:

Compilation

mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
make 

Demos depends on libigl, stb, Eigen, Embree.

Note

This implementation is hard-coded to work best with Courier New Bold.

More Repositories

1

common-3d-test-models

Repository containing common 3D test models in original format with original source if known and obj mesh
Forth
763
star
2

gptoolbox

Matlab toolbox for Geometry Processing.
MATLAB
629
star
3

geometry-processing-csc2520

Course Page for Geometry Processing
MATLAB
334
star
4

geometry-processing

Course material for a grad-level course in Geometry Processing.
293
star
5

coloremoji.sty

Style package for directly including color emojis in latex documents
TeX
215
star
6

computer-graphics-csc317

Course Page for Computer Graphics course
CSS
184
star
7

geometry-processing-parameterization

Parameterization assignment for Geometry Processing course
C++
148
star
8

geometry-processing-curvature

Curvature assignment for Geometry Processing course
C++
148
star
9

geometry-processing-deformation

Deformation assignment for Geometry Processing course
C++
148
star
10

computer-graphics-bounding-volume-hierarchy

Computer Graphics Assignment about Bounding Volume Hierarchies
C++
123
star
11

geometry-processing-introduction

Introductory assignment for Geometry Processing course
C++
117
star
12

geometry-processing-mesh-reconstruction

Mesh Reconstruction assignment for Geometry Processing course
Pawn
101
star
13

computer-graphics-kinematics

Computer Graphics Assignment about Kinematics
C++
93
star
14

geometry-processing-registration

Registration assignment for Geometry Processing course
C++
86
star
15

nested_cages

Corresponding Code for the SIGGRAPH Asia paper "Nested Cages"
C++
81
star
16

skeleton-builder

C++
61
star
17

FAST

Fast Automatic Skinning Transformations
C++
61
star
18

skeleton-poser

C++
58
star
19

better-code-runtime-polymorphism

Git walk through of the C++ code presented in Sean Parent's talk "Better Code: Runtime Polymorphism"
C++
55
star
20

convex-optimization-cookbook

MATLAB
53
star
21

seminar-on-geometry-and-animation

course webpage
49
star
22

computer-graphics-mass-spring-systems

Computer Graphics Assignment – Mass Spring Systems
C++
48
star
23

computer-graphics

Computer Graphics Course
45
star
24

MeshQuickLookPlugin

QuickLook Plugin (.qlgenerator) for 3D model mesh files (.mesh, .obj, .off, .ply, .stl, .wrl)
C++
45
star
25

geometry-processing-smoothing

Smoothing assignment for Geometry Processing course
C++
41
star
26

sparse-solver-benchmark

CMake
35
star
27

gp-cli

Command Line Tools for Geometry Processing
C++
30
star
28

computer-graphics-ray-casting

Computer Graphics Assignment about Ray Casting
C++
30
star
29

meshfix

Port of Marco Attene's meshfix to compile and run on Mac OS X
C++
27
star
30

computer-graphics-meshes

Computer Graphics Assignment about Meshes
C++
25
star
31

minimal-latex-setup-for-siggraph

TeX
21
star
32

qslim

Port of Michael Garland's QSlim to compile on Mac OS X
C++
21
star
33

puppet

Corresponding code for the SIGGRAPH 2014 paper "Tangible and Modular Input Device for Character Articulation"
C
20
star
34

computer-graphics-raster-images

Computer Graphics Assignment about Raster Images
C++
20
star
35

libigl-tinyad-example

C++
16
star
36

computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
C++
14
star
37

computer-graphics-shader-pipeline

Computer Graphics Assignment about the Shader Pipeline
C++
14
star
38

medit

Port and Modification of Pascal Frey's medit software for tet-mesh visualization
C
14
star
39

geometry-processing-libigl-implementations

C++
12
star
40

libigl-link-example

CMake
8
star
41

glfw-glut

C
6
star
42

fcpw-libigl-example

C++
6
star
43

openmp-on-macos

C++
6
star
44

vim-digraphs-everywhere

Ruby
6
star
45

self-intersection-curves

CMake
6
star
46

multigrid

Multigrid solver for matlab
MATLAB
5
star
47

matlab

just enough matlab to compile gptoolbox's mex folder
Shell
4
star
48

libigl-shadow-mapping

C++
3
star
49

phong-demo

Demonstration of Phong illumination and Phong/Gouraud Shading
JavaScript
3
star
50

latent-space-dynamics-website

CSS
3
star
51

glut

Patched version of glut for os x, supporting vertical/horizontal mouse wheel, command key, core profile.
C
3
star
52

libigl-eigen-mkl

CMake
3
star
53

chalkboard

Raster chalkboard app with pressure sensitive (e.g., for Apple Pencilβ„’) https://alecjacobson.github.io/chalkboard/
HTML
3
star
54

paparazzi-website

Project Page website for Paparazzi
CSS
2
star
55

FLUFFY

CMake
2
star
56

perceptual-study

Web-based perceptual study base code
PHP
2
star
57

consistent-penetrations

C++
2
star
58

libigl-example-project-with-multiple-executables

CMake
2
star
59

math-genealogy

Python
2
star
60

gmp-mpfr-externalproject_add

CMake
2
star
61

low-rank-friction

Jupyter Notebook
1
star
62

cmake-dependency-test

CMake
1
star
63

CoMISo-skinny

C++
1
star
64

libigl-example-triangle

C++
1
star
65

libigl-issue-1656-hot-fix

C++
1
star
66

scatter-gather-symdiff

MATLAB
1
star
67

stop-motion-faces-project-page

CSS
1
star
68

side-by-side

C++
1
star
69

libigl-example-mex

CMake
1
star
70

libigl-skinny

C++
1
star
71

libigl-small

C++
1
star
72

dirac-project-page

Project Page for "A Dirac Operator for Extrinsic Shape Analysis"
CSS
1
star