Giter Site home page Giter Site logo

3d-ascii-viewer's People

Contributors

autopawn avatar dereckson avatar pascalgilbraith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

3d-ascii-viewer's Issues

Including more models with the right licenses

Many people have asked to include specific models in the models/ folders.

However, each model is subject to its own license. All the models I have included so far are Public Domain (the authors are listed in the README).

I want to keep the repo MIT licensed (permissive) but there are many models that we would want to include that are either Creative Commons (often attribution required) or GPL (copyleft). So in theory we shouldn't distribute them as part of a MIT licensed project, because the license is incompatible.

Since I am not more familiar with legal stuff. I wonder if there is a correct way we can add to these models to the repo, perhaps including them in their own folder within models/ with their respective license, and adding a disclaimer in the README that not all models in models/ are MIT licensed or Public domain.

It would be nice if someone with more knowledge in this regard could give some advice.

If this is not possible or recommended, we could may install an "at least MIT licensed" policy for adding models or refer to a separate project that keeps track of them.

On FreeBSD, src/viewer.c:9:10: fatal error: 'argp.h' file not found

As argp.h is part of GNU libc, currently the code only compiles on Linux as is.

On FreeBSD for example, there is a package called argp-standalone for portability, used by Firefox and ffmpeg, which requires:

  • -I/usr/local/include (or better -I$(PREFIX)/include) to get /usr/local/include/argp.h
  • -largp to link against the library

Not sure for the small arguments parsing done that this dependency is worthwhile, as it creates issues of portability for 4 small and simple options. As is, the Makefile only works on Linux.

On Mac OS X, brew also provides argp-standalone, so I guess it will be the same issue for all other OSes.

ratio wrong when terminal very wide

so i've tried to make the terminal very large on a 16:9 screen, and the knight gets really fat:

./viewer -h $LINES -w $(echo $COLUMNS-1|bc) /usr/share/games/brutalchess/models/knight.obj

is there a way to not stretch the object? well probably not. it's 3d, but fonts are usually double high than wide (+/-), depending on the font, and screen/resolution (pixels being square or not, visible with circles)

Document ncurses is required

src/surface.c:4:10: fatal error: ncurses.h: No such file or directory
    4 | #include <ncurses.h>
      |          ^~~~~~~~~~~
compilation terminated.

On Debian, it requires for example the package libncurses-dev

Segfault when compiled with llvm - model address is 0x2

Compiled like described in #1.

❯ ./viewer models/fox.obj
zsh: segmentation fault (core dumped)  ./viewer models/fox.obj

❯ lldb viewer
(lldb) run models/fox.obj
Process 79110 launched: '/datacube/ascii-sandbox/3d-ascii-viewer-c/viewer' (x86_64)
Process 79110 stopped
* thread #1, name = 'viewer', stop reason = signal SIGSEGV: invalid address (fault address: 0x2)
    frame #0: 0x00000000002032f8 viewer`model_add_vertex + 40
viewer`model_add_vertex:
->  0x2032f8 <+40>: movl   (%rax), %eax
    0x2032fa <+42>: movq   -0x28(%rbp), %rcx
    0x2032fe <+46>: cmpl   0x4(%rcx), %eax
    0x203301 <+49>: jne    0x203366                  ; <+150>

I've the same stacktrace when compiling with -g to enable debug symbols.

This is this method:

static void model_add_vertex(struct model *model, vec3 vec)
{
    if (model->vertex_count == model->vertex_capacity)
    {
        model->vertex_capacity *= 2;
        if (!(model->vertexes = realloc(model->vertexes, model->vertex_capacity * sizeof(*model->vertexes))))
        {
            fprintf(stderr, "ERROR: Memory allocation failure.\n");
            exit(1);
        }
    }

    model->vertexes[model->vertex_count] = vec;
    model->vertex_count++;
}

Stacktrace:

  * frame #0: 0x000000000020343c viewer`model_add_vertex(model=0x0000000000000002, vec=(x = 0.315012991, y = 1.986498, z = 0.311190993)) at model.c:40:41
    frame #1: 0x00000000002030e4 viewer`model_load_from_obj(fname="models/fox.obj") at model.c:283:13
    frame #2: 0x0000000000203c10 viewer`main + 112
    frame #3: 0x0000000000202920 viewer`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1_c.c:75:7

The model address is 0x2 (confirmed with lldb and with a printf("Address for model: %p\n", model);)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.